hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f30ba55c15f29bf30749e56c200370e76ea9326f | 10,749 | py | Python | sdk/python/pulumi_aws/cloudformation/get_cloud_formation_type.py | alexbowers/pulumi-aws | 7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/cloudformation/get_cloud_formation_type.py | alexbowers/pulumi-aws | 7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/cloudformation/get_cloud_formation_type.py | alexbowers/pulumi-aws | 7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 38.945652 | 339 | 0.662852 |
cbbcce447f1dfc70d2bc71bcef6894756b8fb880 | 905 | py | Python | code/ordered_radicals/sol_124.py | bhavinjawade/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | 2 | 2020-07-16T08:16:32.000Z | 2020-10-01T07:16:48.000Z | code/ordered_radicals/sol_124.py | Psingh12354/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | null | null | null | code/ordered_radicals/sol_124.py | Psingh12354/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | 1 | 2021-05-07T18:06:08.000Z | 2021-05-07T18:06:08.000Z |
# -*- coding: utf-8 -*-
'''
File name: code\ordered_radicals\sol_124.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #124 :: Ordered radicals
#
# For more information see:
# https://projecteuler.net/problem=124
# Problem Statement
'''
T... | 13.507463 | 138 | 0.644199 |
4c69a66ab24eaffecad214700d54db557c797884 | 7,219 | py | Python | models/model.py | alexcwsmith/TRAILMAP | 3f5adcc34341add14561be7b44d240aa712444e9 | [
"MIT"
] | 29 | 2019-11-12T22:36:51.000Z | 2021-12-16T00:11:44.000Z | models/model.py | alexcwsmith/TRAILMAP | 3f5adcc34341add14561be7b44d240aa712444e9 | [
"MIT"
] | 14 | 2019-11-06T19:19:00.000Z | 2022-01-25T21:14:13.000Z | models/model.py | alexcwsmith/TRAILMAP | 3f5adcc34341add14561be7b44d240aa712444e9 | [
"MIT"
] | 13 | 2019-10-22T12:53:33.000Z | 2022-03-15T20:15:52.000Z | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Conv3D, MaxPooling3D, BatchNormalization, Conv3DTranspose, concatenate, \
Cropping3D, Input
from tensorflow.keras.optimizers import Adam
input_dim = 64
output_dim = 36
d... | 35.915423 | 126 | 0.655769 |
a1263acea3b976b7cf9136be5c6ccbf7ee3d1452 | 282 | py | Python | utils/extract_version.py | Piumal1999/asset-registry | ecf291f963571fc3933f3b91b867f1b42e4885bb | [
"MIT"
] | null | null | null | utils/extract_version.py | Piumal1999/asset-registry | ecf291f963571fc3933f3b91b867f1b42e4885bb | [
"MIT"
] | 3 | 2021-11-24T17:53:08.000Z | 2022-01-10T05:18:05.000Z | utils/extract_version.py | Piumal1999/asset-registry | ecf291f963571fc3933f3b91b867f1b42e4885bb | [
"MIT"
] | 1 | 2021-11-14T10:05:51.000Z | 2021-11-14T10:05:51.000Z | import os
import sys
env_file = os.getenv('GITHUB_ENV')
def set_actions_env_var(var_name, value):
with open(env_file, "a") as my_file:
my_file.write(str(var_name) + "=" + str(value) + "\n")
string = sys.argv[1]
set_actions_env_var("VERSION", string.split(":")[-1])
| 20.142857 | 62 | 0.666667 |
c5cf926bea6c7b931bf2fa5d098eb2d5d412fa0d | 9,970 | py | Python | models/RelationNetworks/relation_rcnn/operator_py/proposal.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/RelationNetworks/relation_rcnn/operator_py/proposal.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/RelationNetworks/relation_rcnn/operator_py/proposal.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Relation Networks for Object Detection
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Yuwen Xiong
# --------------------------------------------------------
# Based on:
# MX-RCNN
# Copyright (c) 2016 by... | 39.721116 | 119 | 0.611535 |
b9b8f86949db8544ed43d8767b0ac873ddfb6c57 | 1,660 | py | Python | db.py | Shreyas-pandith/mlh-localhost-build-and-deploy-aws | a163dd305af45c7a0b89aab58c1c5db9b6a31386 | [
"MIT"
] | null | null | null | db.py | Shreyas-pandith/mlh-localhost-build-and-deploy-aws | a163dd305af45c7a0b89aab58c1c5db9b6a31386 | [
"MIT"
] | null | null | null | db.py | Shreyas-pandith/mlh-localhost-build-and-deploy-aws | a163dd305af45c7a0b89aab58c1c5db9b6a31386 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, BigInteger ,String ,ForeignKey
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
import config
d... | 26.349206 | 73 | 0.65 |
88c6c2743d91c659914bbdc844966cbb3c4c47df | 6,682 | py | Python | game.py | Siedler/Owela | cdaa3218846d78cf93a90ff6c4740ac3020275ee | [
"Apache-2.0"
] | null | null | null | game.py | Siedler/Owela | cdaa3218846d78cf93a90ff6c4740ac3020275ee | [
"Apache-2.0"
] | null | null | null | game.py | Siedler/Owela | cdaa3218846d78cf93a90ff6c4740ac3020275ee | [
"Apache-2.0"
] | null | null | null | from textwrap import dedent
import time
import random
max_field_count = -1
class Game:
def __init__(self):
self.state = [
[2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 0, 0, 0, 0, 0],
[2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 0, 0, 0, 0, 0]]
def copy(self):
copie... | 31.668246 | 90 | 0.555672 |
bd5a2769a140376efb9a2c5ac936e32bef53aaf6 | 2,455 | py | Python | app.py | bhavsarpratik/jina-icd10-entity-search | c7c1225a63d9e89eb7d9c0458661fd630d824e8d | [
"MIT"
] | 1 | 2021-08-08T09:41:59.000Z | 2021-08-08T09:41:59.000Z | app.py | bhavsarpratik/jina-icd10-entity-search | c7c1225a63d9e89eb7d9c0458661fd630d824e8d | [
"MIT"
] | null | null | null | app.py | bhavsarpratik/jina-icd10-entity-search | c7c1225a63d9e89eb7d9c0458661fd630d824e8d | [
"MIT"
] | 1 | 2021-11-13T06:48:36.000Z | 2021-11-13T06:48:36.000Z | import os
import shutil
import click
from jina.flow import Flow
def clean_workdir():
if os.path.exists(os.environ['JINA_WORKSPACE']):
shutil.rmtree(os.environ['JINA_WORKSPACE'])
def config():
os.environ['JINA_DATA_FILE'] = 'data/icd10.csv'
os.environ['JINA_WORKSPACE'] = 'workspace'
os.environ... | 25.572917 | 111 | 0.576782 |
6375fe081324045bf083c2e6456de5f9335f5dfc | 2,331 | py | Python | 02.1a) F to C temp; Force, Energy and Work.py | malikcaukiel/malikcaukiel-Some_Physics | afe1cb56c08255bd348b7096e979c848f2e5c7dd | [
"MIT"
] | 1 | 2020-04-02T16:52:23.000Z | 2020-04-02T16:52:23.000Z | 02.1a) F to C temp; Force, Energy and Work.py | malikcaukiel/malikcaukiel-Some_Physics | afe1cb56c08255bd348b7096e979c848f2e5c7dd | [
"MIT"
] | null | null | null | 02.1a) F to C temp; Force, Energy and Work.py | malikcaukiel/malikcaukiel-Some_Physics | afe1cb56c08255bd348b7096e979c848f2e5c7dd | [
"MIT"
] | null | null | null | ### fahrenheit to centigrade ###
"""
def f_to_c(f_temp):
c_temp = (f_temp - 32) * 5/9
return c_temp
print(f_to_c(98.6))
"""
#####################################################################################... | 35.318182 | 140 | 0.493779 |
d2ba0d1b9e5da8af17c434ea8d4243430a72264f | 769 | py | Python | setup.py | mrmh2/dtool-azure | efc24feb5ebb8bdb663ceabfa4b0a7b15d985b67 | [
"MIT"
] | null | null | null | setup.py | mrmh2/dtool-azure | efc24feb5ebb8bdb663ceabfa4b0a7b15d985b67 | [
"MIT"
] | 1 | 2020-01-24T14:24:01.000Z | 2020-01-24T14:24:01.000Z | setup.py | mrmh2/dtool-azure | efc24feb5ebb8bdb663ceabfa4b0a7b15d985b67 | [
"MIT"
] | null | null | null | from setuptools import setup
url = "https://github.com/jic-dtool/dtool-azure"
version = "0.7.1"
readme = open('README.rst').read()
setup(
name="dtool-azure",
packages=["dtool_azure"],
version=version,
description="Add Azure dataset support to dtool",
long_description=readme,
include_package_da... | 25.633333 | 78 | 0.643693 |
734f38ec0e60e710bc7f6b2182a52970080c17d9 | 35,632 | py | Python | nova/tests/api/openstack/compute/contrib/test_floating_ips.py | berrange/nova | 2dea6662cdf15558edd3f0bf33642e7c6e18cb5c | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/contrib/test_floating_ips.py | berrange/nova | 2dea6662cdf15558edd3f0bf33642e7c6e18cb5c | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/contrib/test_floating_ips.py | berrange/nova | 2dea6662cdf15558edd3f0bf33642e7c6e18cb5c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Eldar Nugaev
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://... | 42.62201 | 79 | 0.61992 |
4aea0bf189f5d292214ee90960b8b39c9f37a1da | 15,339 | py | Python | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | MartinNeupauer/mongo | 6cc2dfe7edd312b8596355edef454e15988e350e | [
"Apache-2.0"
] | null | null | null | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | MartinNeupauer/mongo | 6cc2dfe7edd312b8596355edef454e15988e350e | [
"Apache-2.0"
] | 2 | 2021-03-26T00:01:11.000Z | 2021-03-26T00:02:19.000Z | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | MartinNeupauer/mongo | 6cc2dfe7edd312b8596355edef454e15988e350e | [
"Apache-2.0"
] | null | null | null | """
Sharded cluster fixture for executing JSTests against.
"""
from __future__ import absolute_import
import copy
import os.path
import socket
import time
import pymongo
from . import interface
from . import standalone
from . import replicaset
from ... import config
from ... import core
from ... import errors
from ... | 39.230179 | 100 | 0.58348 |
399839b0a9c4082937e7f5c7df09ad044314c45e | 804 | py | Python | 05-first-class_functions/argument.py | sexyjoon/fluent-python | 8635960f99cd3c46bd8b839e34a148885180164d | [
"CNRI-Python"
] | null | null | null | 05-first-class_functions/argument.py | sexyjoon/fluent-python | 8635960f99cd3c46bd8b839e34a148885180164d | [
"CNRI-Python"
] | 1 | 2021-06-02T00:33:53.000Z | 2021-06-02T00:33:53.000Z | 05-first-class_functions/argument.py | sexyjoon/fluent-python | 8635960f99cd3c46bd8b839e34a148885180164d | [
"CNRI-Python"
] | null | null | null | def tag(name, *content, cls=None, **attrs):
'''Create tags at least 1'''
if cls is not None:
attrs['class'] = cls
if attrs:
attr_str = ''.join(' %s="%s"' % (attr, value) for attr, value in sorted(attrs.items()))
else:
attr_str = ''
if content:
return '\n'.join('<%s%s... | 33.5 | 96 | 0.534826 |
7a2b045520b728650055af4c303c320d368f3332 | 4,369 | py | Python | python/GafferUI/StringPlugValueWidget.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/StringPlugValueWidget.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/StringPlugValueWidget.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011-2013, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... | 37.663793 | 129 | 0.710689 |
8b4285db1363ef7d660b6f63a335db8e45e8202d | 480 | py | Python | vyper/types/check.py | siraben/vyper | fc9348b997b571e2b608e89b899362143f78d754 | [
"MIT"
] | null | null | null | vyper/types/check.py | siraben/vyper | fc9348b997b571e2b608e89b899362143f78d754 | [
"MIT"
] | null | null | null | vyper/types/check.py | siraben/vyper | fc9348b997b571e2b608e89b899362143f78d754 | [
"MIT"
] | null | null | null | # stub file to factor type checker into
# for now just call into existing code
from vyper.parser.parser_utils import make_setter
# Check assignment from rhs to lhs.
# For now use make_setter for its typechecking side effects
def check_assign(lhs, rhs, pos, in_function_call=False):
make_setter(lhs, rhs,
... | 32 | 59 | 0.70625 |
623cc019fa11e741159d1fd2029685050df610f4 | 194 | py | Python | checkScriptRunning.py | destro-2698/CowinPortalOTPRequestBot | 70041c19e10a18ccc87dbb71f9a9be567e439340 | [
"Apache-2.0"
] | null | null | null | checkScriptRunning.py | destro-2698/CowinPortalOTPRequestBot | 70041c19e10a18ccc87dbb71f9a9be567e439340 | [
"Apache-2.0"
] | null | null | null | checkScriptRunning.py | destro-2698/CowinPortalOTPRequestBot | 70041c19e10a18ccc87dbb71f9a9be567e439340 | [
"Apache-2.0"
] | null | null | null | import subprocess
pytonProcess = subprocess.check_output("ps -ef | grep botStart.py",shell=True).decode()
pytonProcess = pytonProcess.split('\n')
for process in pytonProcess:
print(process)
| 21.555556 | 87 | 0.768041 |
23ac69d38d825576ceeb77e3bc35b9b6e3cab86e | 3,082 | py | Python | visualization/mpl_curve3d_tangents.py | orbingol/NURBS-Python_Examples | c99d8cd3d20e7523694ce62f72760b260582fa11 | [
"MIT"
] | 48 | 2017-12-14T09:54:48.000Z | 2020-03-30T13:34:44.000Z | visualization/mpl_curve3d_tangents.py | GabrielJie/NURBS-Python_Examples | c99d8cd3d20e7523694ce62f72760b260582fa11 | [
"MIT"
] | 7 | 2020-05-27T04:27:24.000Z | 2021-05-25T16:11:39.000Z | visualization/mpl_curve3d_tangents.py | GabrielJie/NURBS-Python_Examples | c99d8cd3d20e7523694ce62f72760b260582fa11 | [
"MIT"
] | 37 | 2017-10-14T08:11:11.000Z | 2020-05-04T02:51:58.000Z | # -*- coding: utf-8 -*-
"""
Visualization Examples for the NURBS-Python Package
Released under The MIT License
Developed by Onur Rauf Bingol (c) 2018
Creates a 3-dimensional curve and plots tangent vectors
"""
import os
from geomdl import BSpline
from geomdl import utilities
from geomdl import exchang... | 27.517857 | 119 | 0.725503 |
a25a8d9a1889341615e9530faa698a2fc4aba4f8 | 1,900 | py | Python | src/use_cases/user/register.py | WebisD/chat-irc-protocol | 6720d1789a366bfd7943b81c7c84cb0941c66e80 | [
"MIT"
] | null | null | null | src/use_cases/user/register.py | WebisD/chat-irc-protocol | 6720d1789a366bfd7943b81c7c84cb0941c66e80 | [
"MIT"
] | null | null | null | src/use_cases/user/register.py | WebisD/chat-irc-protocol | 6720d1789a366bfd7943b81c7c84cb0941c66e80 | [
"MIT"
] | 3 | 2021-06-03T12:27:27.000Z | 2021-06-14T22:48:36.000Z | import sys
from entities.ent_user import *
from util import *
__all__ = ['Register']
class Register:
"""Class to register the user in the server"""
@staticmethod
def response(user, server, args) -> User:
"""Performs the register of user in the server
:param server: IP where the... | 30.645161 | 120 | 0.541053 |
356e37450a839267575091ce157496af99770eb2 | 3,524 | py | Python | source/hive-year1-summary.py | jdwapman/docs | c6d9979803c7b91ddfe02b61018d30038d47abf8 | [
"Apache-2.0"
] | null | null | null | source/hive-year1-summary.py | jdwapman/docs | c6d9979803c7b91ddfe02b61018d30038d47abf8 | [
"Apache-2.0"
] | null | null | null | source/hive-year1-summary.py | jdwapman/docs | c6d9979803c7b91ddfe02b61018d30038d47abf8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# run as
# ./hive-year1-summary.py && open darpa.pdf
import os
import tempfile
import subprocess
import re
files = sorted([f for f in os.listdir('.')
if ((f.startswith('hive_') and
f.endswith('.html.md') and
f != 'hive_year1_summary.htm... | 43.506173 | 432 | 0.644722 |
e3597be4a6d8b0ec372a969ef8e550a9f6bf1204 | 1,254 | py | Python | Leetcode-Practices-By-Topic/Sorting/56.merge-intervals.py | billzhonggz/Algorithms | ca6c469576765caa1f5796c85e44c8dc00b05171 | [
"MIT"
] | null | null | null | Leetcode-Practices-By-Topic/Sorting/56.merge-intervals.py | billzhonggz/Algorithms | ca6c469576765caa1f5796c85e44c8dc00b05171 | [
"MIT"
] | null | null | null | Leetcode-Practices-By-Topic/Sorting/56.merge-intervals.py | billzhonggz/Algorithms | ca6c469576765caa1f5796c85e44c8dc00b05171 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=56 lang=python3
#
# [56] Merge Intervals
#
# @lc code=start
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
"""Attempt 1
1. Sort the intervals by the first element in increasing order.
2. Two intervals are overlapping if the first elem... | 35.828571 | 114 | 0.515949 |
c173a56d7e182771eba4f62d69a76073dd981cca | 1,301 | py | Python | sissy_university/data_wrangler.py | ruffiana/SissyUniversity | 06df8f07844742429831ab004ff5fc0489c1a7f9 | [
"BSD-2-Clause"
] | 6 | 2020-11-06T03:45:25.000Z | 2021-10-13T07:34:21.000Z | sissy_university/data_wrangler.py | ruffiana/SissyUniversity | 06df8f07844742429831ab004ff5fc0489c1a7f9 | [
"BSD-2-Clause"
] | null | null | null | sissy_university/data_wrangler.py | ruffiana/SissyUniversity | 06df8f07844742429831ab004ff5fc0489c1a7f9 | [
"BSD-2-Clause"
] | null | null | null | """
Collection of tools and functions for managing/updating local data files
**Author:**
Ruffiana, ruffiana.plays@gmail.com, 9/28/2020
"""
import json
from pprint import pprint
try:
from .data import Json
from .const import *
except ImportError:
from data import Json
from const import *
def u... | 20.983871 | 72 | 0.614143 |
7af6474171814db6685d94458fd5c5475f065b5b | 65,055 | py | Python | mongoengine/fields.py | malderete/mongoengine | 2803404360332d1e2c951415b7a72402bce8b113 | [
"MIT"
] | null | null | null | mongoengine/fields.py | malderete/mongoengine | 2803404360332d1e2c951415b7a72402bce8b113 | [
"MIT"
] | null | null | null | mongoengine/fields.py | malderete/mongoengine | 2803404360332d1e2c951415b7a72402bce8b113 | [
"MIT"
] | null | null | null | import datetime
import decimal
import itertools
import re
import time
import urllib2
import uuid
import warnings
from operator import itemgetter
try:
import dateutil
except ImportError:
dateutil = None
else:
import dateutil.parser
import pymongo
import gridfs
from bson import Binary, DBRef, SON, ObjectId
... | 32.856061 | 138 | 0.592176 |
d0dc89cc92b3ac9ffe80fdf73b17ee659ea9085d | 21,615 | py | Python | python_on_whales/components/buildx/cli_wrapper.py | ucam-department-of-psychiatry/python-on-whales | f3171814089b16b88c407f316048f830f45eaa4e | [
"MIT"
] | 191 | 2020-12-02T19:35:00.000Z | 2022-03-31T22:41:48.000Z | python_on_whales/components/buildx/cli_wrapper.py | ucam-department-of-psychiatry/python-on-whales | f3171814089b16b88c407f316048f830f45eaa4e | [
"MIT"
] | 94 | 2020-12-18T16:36:38.000Z | 2022-03-31T00:06:39.000Z | python_on_whales/components/buildx/cli_wrapper.py | ucam-department-of-psychiatry/python-on-whales | f3171814089b16b88c407f316048f830f45eaa4e | [
"MIT"
] | 33 | 2020-12-17T20:32:31.000Z | 2022-03-29T10:23:06.000Z | from __future__ import annotations
import json
import tempfile
from enum import Enum
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional, Union
import python_on_whales.components.image.cli_wrapper
from python_on_whales.client_config import (
ClientConfig,
DockerCLICaller,
Reloa... | 39.086799 | 98 | 0.591904 |
f173c5294d0c18ea2ffbeb6c49acca514a616bdb | 7,837 | py | Python | twilio/docs/conf.py | vinothpofi/1bookingz | 053bebb0792c2be8779e8a472ca9ab1e2c760916 | [
"MIT"
] | null | null | null | twilio/docs/conf.py | vinothpofi/1bookingz | 053bebb0792c2be8779e8a472ca9ab1e2c760916 | [
"MIT"
] | null | null | null | twilio/docs/conf.py | vinothpofi/1bookingz | 053bebb0792c2be8779e8a472ca9ab1e2c760916 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Services_Twilio documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 8 04:02:01 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 34.524229 | 82 | 0.681766 |
38da1ed2386a2bb8b67828c93d357bfd9518f922 | 1,120 | py | Python | voxel_globe/meta/fields.py | ngageoint/voxel-globe | 91f386de652b704942165889c10468b2c4cf4eec | [
"MIT"
] | 28 | 2015-07-27T23:57:24.000Z | 2020-04-05T15:10:52.000Z | voxel_globe/meta/fields.py | VisionSystemsInc/voxel_globe | 6eb3fca5586726428e9d914f7b730ca164c64a52 | [
"MIT"
] | 50 | 2016-02-11T15:50:22.000Z | 2016-10-27T22:38:27.000Z | voxel_globe/meta/fields.py | ngageoint/voxel-globe | 91f386de652b704942165889c10468b2c4cf4eec | [
"MIT"
] | 8 | 2015-07-27T19:22:03.000Z | 2021-01-04T09:44:48.000Z | import os
from django.contrib.gis.db import models
from django.utils.translation import ugettext_lazy
def validate_file(value):
return os.path.isfile(os.path.expandvars(value)) or \
os.path.isdir(os.path.expandvars(value))
class FileNameField(models.TextField):
#Field for a file or directory
default_va... | 32 | 75 | 0.680357 |
64c52a0b480cca6e8693e1645c070878007e884a | 2,819 | py | Python | src/demuxfb/_progress_reporter.py | nick-killeen/demuxfb | 9c9a89c3b3116add018f98ef9e11ae335395692a | [
"MIT"
] | null | null | null | src/demuxfb/_progress_reporter.py | nick-killeen/demuxfb | 9c9a89c3b3116add018f98ef9e11ae335395692a | [
"MIT"
] | null | null | null | src/demuxfb/_progress_reporter.py | nick-killeen/demuxfb | 9c9a89c3b3116add018f98ef9e11ae335395692a | [
"MIT"
] | null | null | null | """Module for logic about reporting on the long progress of `Chat` creation."""
from abc import ABC, abstractmethod
from typing import Callable, Any
import datetime
from .message import Message
class ProgressReporter(ABC):
"""
Interface for reporting on progress during the construction of a chat, which
... | 31.674157 | 80 | 0.647747 |
ebcc31226b895fb9fd5f7de0f1b8298345da8075 | 11,036 | py | Python | venv/Lib/site-packages/pandas/tests/groupby/test_quantile.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | venv/Lib/site-packages/pandas/tests/groupby/test_quantile.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 8 | 2021-09-22T12:47:32.000Z | 2022-01-14T21:30:38.000Z | venv/Lib/site-packages/pandas/tests/groupby/test_quantile.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 3 | 2020-08-04T02:48:32.000Z | 2020-08-17T01:20:09.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
)
import pandas._testing as tm
@pytest.mark.parametrize(
"interpolation", ["linear", "lower", "higher", "nearest", "midpoint"]
)
@pytest.mark.parametrize(
"a_vals,b_vals",
[
# Ints
([1, 2, ... | 33.34139 | 88 | 0.561707 |
ba073c1d9e85bb876647d0880ee9d2619f03518b | 3,875 | py | Python | google-datacatalog-sqlserver-connector/tests/google/datacatalog_connectors/sqlserver/scrape/metadata_scraper_test.py | brucearctor/datacatalog-connectors-rdbms | 7ff5dc858ea7aa21486343304fc281692480cdb8 | [
"Apache-2.0"
] | 46 | 2020-04-27T21:55:50.000Z | 2022-02-06T04:34:06.000Z | google-datacatalog-sqlserver-connector/tests/google/datacatalog_connectors/sqlserver/scrape/metadata_scraper_test.py | brucearctor/datacatalog-connectors-rdbms | 7ff5dc858ea7aa21486343304fc281692480cdb8 | [
"Apache-2.0"
] | 45 | 2020-05-20T21:09:04.000Z | 2022-03-24T00:14:30.000Z | google-datacatalog-sqlserver-connector/tests/google/datacatalog_connectors/sqlserver/scrape/metadata_scraper_test.py | brucearctor/datacatalog-connectors-rdbms | 7ff5dc858ea7aa21486343304fc281692480cdb8 | [
"Apache-2.0"
] | 47 | 2020-05-02T14:48:06.000Z | 2022-03-28T22:12:22.000Z | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 35.87963 | 76 | 0.598194 |
37a3c517e3d2c41653bd698443f6508040b57312 | 6,724 | py | Python | testing/test_split_dataset.py | AshkanTaghipour/ivadomed | 84c4e01831265b311c7b053ffdb19fb393fb135d | [
"MIT"
] | null | null | null | testing/test_split_dataset.py | AshkanTaghipour/ivadomed | 84c4e01831265b311c7b053ffdb19fb393fb135d | [
"MIT"
] | null | null | null | testing/test_split_dataset.py | AshkanTaghipour/ivadomed | 84c4e01831265b311c7b053ffdb19fb393fb135d | [
"MIT"
] | null | null | null | import os
import csv
import json
import shutil
import pytest
import numpy as np
from ivadomed.loader import utils as imed_loader_utils
BIDS_PATH = 'bids'
LOG_PATH = 'log'
N = 200
N_CENTERS = 5
@pytest.mark.parametrize('split_params', [{
"fname_split": None,
"random_seed": 6,
"center_test": ... | 30.425339 | 105 | 0.64307 |
279fe064210fdbceaf174bb71d4940b0f3dcaa65 | 2,212 | py | Python | kibom/xml_writer.py | optimiseddesign/KiBoM | 499cd979e82a2242f78b94569df04966234104f9 | [
"MIT"
] | 274 | 2016-05-17T07:57:33.000Z | 2022-03-30T15:58:52.000Z | kibom/xml_writer.py | optimiseddesign/KiBoM | 499cd979e82a2242f78b94569df04966234104f9 | [
"MIT"
] | 141 | 2016-08-01T19:04:40.000Z | 2022-03-31T14:29:00.000Z | kibom/xml_writer.py | optimiseddesign/KiBoM | 499cd979e82a2242f78b94569df04966234104f9 | [
"MIT"
] | 91 | 2016-05-15T11:26:26.000Z | 2022-02-23T16:02:35.000Z | """
Write BoM out to an XML file
filename = path to output file (must be a .xml)
groups = [list of ComponentGroup groups]
net = netlist object
headings = [list of headings to display in the BoM file]
prefs = BomPref object
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from xml.etree import Eleme... | 32.057971 | 118 | 0.646926 |
ca976332df60dc81023bebc845f38eaab1e60406 | 2,278 | py | Python | bstore/config.py | LEB-EPFL/bstore | 471a24b84f18c7efe0c3e52632fc14fa27611e50 | [
"BSD-3-Clause"
] | 5 | 2016-08-29T10:01:43.000Z | 2017-09-14T12:12:33.000Z | bstore/config.py | LEB-EPFL/bstore | 471a24b84f18c7efe0c3e52632fc14fa27611e50 | [
"BSD-3-Clause"
] | 63 | 2016-07-25T06:49:00.000Z | 2018-04-25T17:14:21.000Z | bstore/config.py | LEB-EPFL/bstore | 471a24b84f18c7efe0c3e52632fc14fa27611e50 | [
"BSD-3-Clause"
] | 1 | 2019-06-24T07:40:28.000Z | 2019-06-24T07:40:28.000Z | __bstore_Version__ = '1.3.0-dev'
"""__HDF_AtomID_Prefix__ : str
String that precedes all attributes marking dataset
identifiers in an HDF datastore.
"""
__HDF_AtomID_Prefix__ = 'SMLM_'
"""___HDF_Metadata_Prefix : str
String that precedes all attributes marking metadata elements in
an HDF datastore.
... | 29.205128 | 79 | 0.676471 |
03d5b121b252fb303b58849d9c63fda69f245482 | 135,572 | py | Python | lrs/tests/test_Statement.py | DamavandiKamali/ADL_LRS | b0a0f894de02976c69938b9e883fd7b05bbf6d30 | [
"Apache-2.0"
] | null | null | null | lrs/tests/test_Statement.py | DamavandiKamali/ADL_LRS | b0a0f894de02976c69938b9e883fd7b05bbf6d30 | [
"Apache-2.0"
] | null | null | null | lrs/tests/test_Statement.py | DamavandiKamali/ADL_LRS | b0a0f894de02976c69938b9e883fd7b05bbf6d30 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import base64
import uuid
import urllib.request, urllib.parse, urllib.error
import hashlib
from datetime import datetime, timedelta
from django.test import TestCase
from django.urls import reverse
from django.utils.timezone import utc
from django.conf import settings
from django.te... | 64.588852 | 306 | 0.538843 |
49542bca83fb31a1394bc0ce675e4a920261f598 | 1,021 | py | Python | neon/__init__.py | kashif/neon | d4d8ed498ee826b67f5fda1746d2d65c8ce613d2 | [
"Apache-2.0"
] | 3 | 2017-02-02T05:20:48.000Z | 2021-07-07T16:50:41.000Z | neon/__init__.py | kashif/neon | d4d8ed498ee826b67f5fda1746d2d65c8ce613d2 | [
"Apache-2.0"
] | null | null | null | neon/__init__.py | kashif/neon | d4d8ed498ee826b67f5fda1746d2d65c8ce613d2 | [
"Apache-2.0"
] | 2 | 2016-06-09T13:05:00.000Z | 2021-02-18T14:18:15.000Z | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | 40.84 | 78 | 0.619001 |
3acec4405c183d3d327928e6c737e3773ac13e19 | 6,619 | py | Python | programs/util/newplugin.py | mukai154/webblen-io | 307a7fc212c321ebedbc8ebcc113cc3cf4744085 | [
"MIT"
] | 10 | 2017-11-15T05:15:57.000Z | 2021-05-21T06:35:12.000Z | programs/util/newplugin.py | mukai154/webblen-io | 307a7fc212c321ebedbc8ebcc113cc3cf4744085 | [
"MIT"
] | 2 | 2018-07-09T09:44:50.000Z | 2018-10-08T14:12:11.000Z | programs/util/newplugin.py | mukai154/webblen-io | 307a7fc212c321ebedbc8ebcc113cc3cf4744085 | [
"MIT"
] | 6 | 2017-12-05T03:42:06.000Z | 2018-06-05T09:42:11.000Z | #!/usr/bin/env python3
templates = {
"plugin.json" :
"""{{
"plugin_name": "{plugin_name}",
"plugin_project": "{plugin_provider}_{plugin_name}"
}}
""",
"CMakeLists.txt" :
"""file(GLOB HEADERS "include/{plugin_provider}/plugins/{plugin_name}/*.hpp")
add_library( {plugin_provider}_{plugin_name}
${{HE... | 25.956863 | 118 | 0.689379 |
612428851104e714b1e76be35028cadd857c3f0c | 5,010 | py | Python | Collections-a-installer/community-general-2.4.0/plugins/modules/net_tools/gandi_livedns.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/net_tools/gandi_livedns.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/net_tools/gandi_livedns.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019 Gregory Thiemonge <gregory.thiemonge@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
m... | 26.648936 | 104 | 0.568862 |
84ea4b429ab70e43ac26457c8cf64f98db7a3a94 | 4,904 | py | Python | calaccess_processed/models/filings/campaign/form460/base.py | dwillis/django-calaccess-processed-data | f228252df1b390967468b41d336839f1bd9ca192 | [
"MIT"
] | 1 | 2021-01-13T12:06:25.000Z | 2021-01-13T12:06:25.000Z | calaccess_processed/models/filings/campaign/form460/base.py | anthonyjpesce/django-calaccess-processed-data | d99b461abb7b7f7973f90b49634c9262efcbe7bf | [
"MIT"
] | null | null | null | calaccess_processed/models/filings/campaign/form460/base.py | anthonyjpesce/django-calaccess-processed-data | d99b461abb7b7f7973f90b49634c9262efcbe7bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Models for storing data from Campaign Disclosure Statements (Form 460).
"""
from __future__ import unicode_literals
from django.db import models
from calaccess_processed.models.filings.campaign import CampaignFinanceFilingBase
class Form460FilingBase(CampaignFinanceFi... | 35.79562 | 81 | 0.641109 |
a0af6d0234850b8bc5d57b517e38fa0efffbe57d | 16,862 | py | Python | bottom/pack.py | larsks/bottom | eddceacbaef6fda4160ee7f6f1c375e84fbb99fc | [
"MIT"
] | 63 | 2015-01-03T05:38:35.000Z | 2022-03-28T23:59:13.000Z | bottom/pack.py | larsks/bottom | eddceacbaef6fda4160ee7f6f1c375e84fbb99fc | [
"MIT"
] | 51 | 2015-01-13T04:41:58.000Z | 2022-02-24T04:58:17.000Z | bottom/pack.py | larsks/bottom | eddceacbaef6fda4160ee7f6f1c375e84fbb99fc | [
"MIT"
] | 24 | 2015-01-27T23:15:44.000Z | 2021-06-14T20:31:58.000Z | """ Simplified support for rfc2812 """
# https://tools.ietf.org/html/rfc2812
import collections.abc
from typing import Any, Dict, Optional
def b(field: str, kwargs: Dict[str, Any],
present: Optional[Any] = None, missing: Any = '') -> str:
"""
Return `present` value (default to `field`) if `field` in `kw... | 30.770073 | 79 | 0.506701 |
237d571507a3a636a3119c29772ab32df77548a2 | 12,633 | py | Python | pandas/core/arrays/numpy_.py | mayank1897/pandas | c9e4ba146053f0b59160fd7fad70d9e0f6dab463 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/arrays/numpy_.py | mayank1897/pandas | c9e4ba146053f0b59160fd7fad70d9e0f6dab463 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/arrays/numpy_.py | mayank1897/pandas | c9e4ba146053f0b59160fd7fad70d9e0f6dab463 | [
"BSD-3-Clause"
] | 1 | 2021-04-11T21:22:00.000Z | 2021-04-11T21:22:00.000Z | import numbers
from typing import Tuple, Type, Union
import numpy as np
from numpy.lib.mixins import NDArrayOperatorsMixin
from pandas._libs import lib
from pandas._typing import Scalar
from pandas.compat.numpy import function as nv
from pandas.core.dtypes.dtypes import ExtensionDtype
from pandas.core.dtypes.missing... | 32.392308 | 102 | 0.591942 |
3a2a9201055cf6c678c1fa094d5a43bbf2a88550 | 835 | py | Python | application/flask_math/calculation/Sieve_of_Eratosthenes.py | kouki-0926/Flask_RaspberryPi | 874dc160af038ee717b90fe4a587a42082eb6664 | [
"MIT"
] | null | null | null | application/flask_math/calculation/Sieve_of_Eratosthenes.py | kouki-0926/Flask_RaspberryPi | 874dc160af038ee717b90fe4a587a42082eb6664 | [
"MIT"
] | null | null | null | application/flask_math/calculation/Sieve_of_Eratosthenes.py | kouki-0926/Flask_RaspberryPi | 874dc160af038ee717b90fe4a587a42082eb6664 | [
"MIT"
] | null | null | null | from flask_math.calculation.common.NEWTON_METHOD import NEWTON_METHOD
from flask import flash
def Sieve_of_Eratosthenes(N):
try:
N = int(N)
if N >= 2:
List = list(range(2, N+1))
prime_List = []
MIN = 0
while MIN < NEWTON_METHOD(N):
... | 27.833333 | 70 | 0.48024 |
a58aad6c359cb75d0193531b0f1d00c8e492b17a | 233 | py | Python | src/wsgi_benchmark/eventlet_server.py | jamespic/wsgi_benchmark | d5c02fb7530501a46c22765bf3da7c564a68872d | [
"MIT"
] | null | null | null | src/wsgi_benchmark/eventlet_server.py | jamespic/wsgi_benchmark | d5c02fb7530501a46c22765bf3da7c564a68872d | [
"MIT"
] | null | null | null | src/wsgi_benchmark/eventlet_server.py | jamespic/wsgi_benchmark | d5c02fb7530501a46c22765bf3da7c564a68872d | [
"MIT"
] | null | null | null | if __name__ == '__main__':
from eventlet import monkey_patch, wsgi
import eventlet
eventlet.sleep()
monkey_patch()
from wsgi_benchmark.handlers import app
wsgi.server(eventlet.listen(('0.0.0.0', 8765)), app)
| 25.888889 | 56 | 0.690987 |
b33d1c8a635fd7aaaed181621c4e12a958b990e1 | 117 | py | Python | mmcls/models/classifiers/__init__.py | ZwwWayne/mmclassification | 2ccc55ce4f783ca34892fe7d91f247d18906a994 | [
"Apache-2.0"
] | 31 | 2020-11-14T02:47:54.000Z | 2021-12-14T06:26:10.000Z | mmcls/models/classifiers/__init__.py | ZwwWayne/mmclassification | 2ccc55ce4f783ca34892fe7d91f247d18906a994 | [
"Apache-2.0"
] | 2 | 2020-09-01T00:53:39.000Z | 2022-01-27T20:26:11.000Z | mmcls/models/classifiers/__init__.py | ZwwWayne/mmclassification | 2ccc55ce4f783ca34892fe7d91f247d18906a994 | [
"Apache-2.0"
] | 4 | 2021-01-14T18:12:38.000Z | 2021-11-11T11:46:50.000Z | from .base import BaseClassifier
from .image import ImageClassifier
__all__ = ['BaseClassifier', 'ImageClassifier']
| 23.4 | 47 | 0.803419 |
c8d07e3a0d77370224c80c642afff6fabbac993c | 2,592 | py | Python | up/tasks/cls/models/postprocess/cls_postprocess.py | ModelTC/EOD | 164bff80486e9ae6a095a97667b365c46ceabd86 | [
"Apache-2.0"
] | 196 | 2021-10-30T05:15:36.000Z | 2022-03-30T18:43:40.000Z | up/tasks/cls/models/postprocess/cls_postprocess.py | ModelTC/EOD | 164bff80486e9ae6a095a97667b365c46ceabd86 | [
"Apache-2.0"
] | 12 | 2021-10-30T11:33:28.000Z | 2022-03-31T14:22:58.000Z | up/tasks/cls/models/postprocess/cls_postprocess.py | ModelTC/EOD | 164bff80486e9ae6a095a97667b365c46ceabd86 | [
"Apache-2.0"
] | 23 | 2021-11-01T07:26:17.000Z | 2022-03-27T05:55:37.000Z | import torch.nn as nn
import torch.nn.functional as F
from up.utils.general.registry_factory import MODULE_ZOO_REGISTRY
from up.utils.model import accuracy as A
from up.models.losses import build_loss
__all__ = ['BaseClsPostProcess']
@MODULE_ZOO_REGISTRY.register('base_cls_postprocess')
class BaseClsPostProcess(nn.M... | 36 | 102 | 0.58912 |
d009eb8d901f7ff3e02b72ccf5942e2c34a932d1 | 662 | py | Python | app/core/management/commands/wait_for_db.py | abexamir/api-blueprint | 8d5c02766c03e9e031aa2ba6233241b2b8af2999 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | abexamir/api-blueprint | 8d5c02766c03e9e031aa2ba6233241b2b8af2999 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | abexamir/api-blueprint | 8d5c02766c03e9e031aa2ba6233241b2b8af2999 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available"""
def handle(self, *args, **options):
self.stdout.write('Waiting... | 33.1 | 74 | 0.65861 |
3c89d9987b16415774bbee64e5accc2b8ccc6a17 | 1,953 | py | Python | lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py | LaudateCorpus1/llvm-project | ff2e0f0c1112558b3f30d8afec7c9882c33c79e3 | [
"Apache-2.0"
] | 605 | 2019-10-18T01:15:54.000Z | 2022-03-31T14:31:04.000Z | lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py | LaudateCorpus1/llvm-project | ff2e0f0c1112558b3f30d8afec7c9882c33c79e3 | [
"Apache-2.0"
] | 3,180 | 2019-10-18T01:21:21.000Z | 2022-03-31T23:25:41.000Z | lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py | LaudateCorpus1/llvm-project | ff2e0f0c1112558b3f30d8afec7c9882c33c79e3 | [
"Apache-2.0"
] | 275 | 2019-10-18T05:27:22.000Z | 2022-03-30T09:04:21.000Z | """ Testing explicit symbol loading via target symbols add. """
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TargetSymbolsAddCommand(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
TestBase.se... | 37.557692 | 83 | 0.673323 |
943dc74984b1132b1c77d2fd612cac04adc48ae0 | 9,568 | py | Python | app/models/collection.py | Midas0615/react-flask-E-commerce | 0d18409e9b58363b8035cce96b930602ec648fbd | [
"MIT"
] | 54 | 2017-08-22T05:59:11.000Z | 2021-09-28T06:48:23.000Z | app/models/collection.py | Midas0615/react-flask-E-commerce | 0d18409e9b58363b8035cce96b930602ec648fbd | [
"MIT"
] | 5 | 2021-02-08T20:14:18.000Z | 2021-12-13T19:36:25.000Z | app/models/collection.py | Midas0615/react-flask-E-commerce | 0d18409e9b58363b8035cce96b930602ec648fbd | [
"MIT"
] | 30 | 2017-10-24T19:36:17.000Z | 2021-11-03T04:41:50.000Z | from app import mysql, webapp
from app.models import *
from app.scripts import Indexer
import json
from slugify import slugify
class Collection(Prototype):
def __init__(self, collection_id):
self.data = self.getData(collection_id)
def getData(self, collection_id):
from app import cache
... | 40.714894 | 134 | 0.576505 |
a20764ff763f58fd084f6ca17d0635466ff63eac | 2,075 | py | Python | splunk_add_on_ucc_framework/uccrestbuilder/endpoint/multiple_model.py | artemrys/addonfactory-ucc-generator | 6d2ffc3f46d67fd136dbbb009bb7e7d50aecbbd9 | [
"Apache-2.0"
] | 16 | 2020-10-27T18:51:23.000Z | 2022-03-15T10:01:51.000Z | splunk_add_on_ucc_framework/uccrestbuilder/endpoint/multiple_model.py | artemrys/addonfactory-ucc-generator | 6d2ffc3f46d67fd136dbbb009bb7e7d50aecbbd9 | [
"Apache-2.0"
] | 375 | 2020-09-19T13:03:00.000Z | 2022-03-31T17:12:24.000Z | splunk_add_on_ucc_framework/uccrestbuilder/endpoint/multiple_model.py | artemrys/addonfactory-ucc-generator | 6d2ffc3f46d67fd136dbbb009bb7e7d50aecbbd9 | [
"Apache-2.0"
] | 11 | 2021-01-02T03:25:00.000Z | 2022-03-16T15:50:49.000Z | #
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 25 | 74 | 0.692048 |
bcee0eb010173d883b9d4d53297fe555cbd4d373 | 20,139 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/test_self.py | edithamadi/pitch_one | 40c8d1c67c77e483b29bd326721dde7f4a20120d | [
"Unlicense"
] | 3 | 2018-10-21T14:01:01.000Z | 2018-10-22T14:42:22.000Z | virtual/lib/python3.6/site-packages/pylint/test/test_self.py | edithamadi/pitch_one | 40c8d1c67c77e483b29bd326721dde7f4a20120d | [
"Unlicense"
] | 12 | 2018-10-03T19:45:36.000Z | 2022-03-11T23:54:25.000Z | virtual/lib/python3.6/site-packages/pylint/test/test_self.py | edithamadi/pitch_one | 40c8d1c67c77e483b29bd326721dde7f4a20120d | [
"Unlicense"
] | 3 | 2020-01-19T21:26:14.000Z | 2020-11-04T08:37:38.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2018 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Vlad Temian <vladtemian@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2014 Arun Persaud <arun@nubati.net>
# Copyright (c)... | 40.602823 | 156 | 0.621083 |
f6725025866ffe73263887aeb26b98990d069327 | 2,707 | py | Python | azure-servicefabric/azure/servicefabric/models/node_close_event_py3.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-servicefabric/azure/servicefabric/models/node_close_event_py3.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-servicefabric/azure/servicefabric/models/node_close_event_py3.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2020-07-25T20:36:02.000Z | 2020-07-25T20:36:02.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.402985 | 180 | 0.619874 |
9b82e220c1d461c364ce5bb585236552c1a9524d | 804 | py | Python | solving/sorting/bubblesort.py | williamlagos/chess | 7470479e352bf6fa28215e745af8c42dc20d7a1f | [
"MIT"
] | null | null | null | solving/sorting/bubblesort.py | williamlagos/chess | 7470479e352bf6fa28215e745af8c42dc20d7a1f | [
"MIT"
] | 4 | 2020-04-23T23:17:54.000Z | 2021-07-06T17:44:45.000Z | solving/sorting/bubblesort.py | williamlagos/chess | 7470479e352bf6fa28215e745af8c42dc20d7a1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import math
import os
import random
import re
import sys
# Complete the countSwaps function below.
def countSwaps(a):
n = len(a)
# Constraints check
if n > 600:
return
# Bubble sort algorithm with swaps counting
last = n - 1
numSwaps = 0
arraySorted = False
... | 22.971429 | 106 | 0.539801 |
11488214c3f0082fbbc12674eff545e2ea956288 | 50 | py | Python | day3/exercise/p2.py | AkshayManchanda/Python_Training | 5a50472d118ac6d40145bf1dd60f26864bf9fb6c | [
"MIT"
] | null | null | null | day3/exercise/p2.py | AkshayManchanda/Python_Training | 5a50472d118ac6d40145bf1dd60f26864bf9fb6c | [
"MIT"
] | null | null | null | day3/exercise/p2.py | AkshayManchanda/Python_Training | 5a50472d118ac6d40145bf1dd60f26864bf9fb6c | [
"MIT"
] | null | null | null | l = [3,7,[1,4,'hello']]
l[2][2]='goodbye'
print(l) | 16.666667 | 23 | 0.52 |
a539bbce8383978fa85c6d1371f2b2f4c99c337b | 5,820 | py | Python | tests/dhcpv4/classification/test_v4_classification_release.py | isc-projects/forge | dfec8b41003d6b5a229f69ee93616e0e5cc6d71b | [
"0BSD"
] | 22 | 2015-02-27T11:51:05.000Z | 2022-02-28T12:39:29.000Z | tests/dhcpv4/classification/test_v4_classification_release.py | isc-projects/forge | dfec8b41003d6b5a229f69ee93616e0e5cc6d71b | [
"0BSD"
] | 16 | 2018-10-30T15:00:12.000Z | 2019-01-11T17:55:13.000Z | tests/dhcpv4/classification/test_v4_classification_release.py | isc-projects/forge | dfec8b41003d6b5a229f69ee93616e0e5cc6d71b | [
"0BSD"
] | 11 | 2015-02-27T11:51:36.000Z | 2021-03-30T08:33:54.000Z | """DHCPv4 Client Classification release process"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_msg
import misc
import srv_control
@pytest.mark.v4
@pytest.mark.classification
@pytest.mark.release
def test_v4_client_classification_release_same_chaddr_client_id():
misc.test_setup()
... | 41.870504 | 81 | 0.750172 |
81e8e4ba652fd94f192afd0cf0142a9a96746156 | 8,041 | py | Python | akshare/stock/hk_stock_sina.py | repos-cl/akshare | 94fa42fb095ac4bfa5d8d58673b805d36cc0128e | [
"MIT"
] | 1 | 2021-07-13T01:29:49.000Z | 2021-07-13T01:29:49.000Z | akshare/stock/hk_stock_sina.py | repos-cl/akshare | 94fa42fb095ac4bfa5d8d58673b805d36cc0128e | [
"MIT"
] | null | null | null | akshare/stock/hk_stock_sina.py | repos-cl/akshare | 94fa42fb095ac4bfa5d8d58673b805d36cc0128e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2021/5/29 15:28
Desc: 新浪财经-港股-实时行情数据和历史行情数据(包含前复权和后复权因子)
http://stock.finance.sina.com.cn/hkstock/quotes/00700.html
"""
import requests
import demjson
import pandas as pd
from py_mini_racer import py_mini_racer
from akshare.stock.cons import (
hk_js_decode,
... | 35.422907 | 87 | 0.607138 |
ea3c3171cbc5ed9e81dd791780dcf438a6e5d331 | 9,392 | py | Python | Utils.py | PashaIanko/Covid19Classifier | ee75a2b17babb8c9701351dfaa6052afa083168f | [
"MIT"
] | null | null | null | Utils.py | PashaIanko/Covid19Classifier | ee75a2b17babb8c9701351dfaa6052afa083168f | [
"MIT"
] | 1 | 2022-01-27T13:30:38.000Z | 2022-01-27T13:30:38.000Z | Utils.py | PashaIanko/Covid19Classifier | ee75a2b17babb8c9701351dfaa6052afa083168f | [
"MIT"
] | null | null | null | # Load filenames
import os
import numpy as np
from DataProperties import DataProperties
import cv2
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay
from scipy.signal import convolve2d
import pandas as pd
from ModelUtils import ModelUtils
import... | 27.223188 | 100 | 0.606687 |
b88f0922be73df21e36c5b7c066b667d6da6fcaf | 137 | py | Python | Flappybird/main.py | Yuconium/Flappy-Bird | 2fe6c4e6004d85c2267577e9a548021510f41e84 | [
"MIT"
] | null | null | null | Flappybird/main.py | Yuconium/Flappy-Bird | 2fe6c4e6004d85c2267577e9a548021510f41e84 | [
"MIT"
] | null | null | null | Flappybird/main.py | Yuconium/Flappy-Bird | 2fe6c4e6004d85c2267577e9a548021510f41e84 | [
"MIT"
] | null | null | null | import pygame
import mainwindow
if __name__ == "__main__":
pygame.init()
Screen = mainwindow.Screen(700, 500)
Screen.mainloop() | 19.571429 | 38 | 0.715328 |
a666d6e18b53320ef67e53f9a8055f32f6eba413 | 54,840 | py | Python | src/Meshing.py | livino/PyAero | 11a6d50ed640fdfdcda74423d47f113fdc7e5e3f | [
"MIT"
] | null | null | null | src/Meshing.py | livino/PyAero | 11a6d50ed640fdfdcda74423d47f113fdc7e5e3f | [
"MIT"
] | null | null | null | src/Meshing.py | livino/PyAero | 11a6d50ed640fdfdcda74423d47f113fdc7e5e3f | [
"MIT"
] | null | null | null |
import os
import copy
from datetime import date
import locale
import itertools
import numpy as np
from scipy import interpolate
from PySide2 import QtGui, QtCore, QtWidgets
import PyAero
import GraphicsItemsCollection as gic
import GraphicsItem
import Connect
from Utils import Utils
from Settings imp... | 36.245869 | 90 | 0.494894 |
f4227a6f7aed2b266e65012a2f2eaf19fdccd1b3 | 1,513 | py | Python | airflow/serialization/enums.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | airflow/serialization/enums.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | airflow/serialization/enums.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 29.096154 | 68 | 0.708526 |
fb8d445c21ea2073d5afa0ca29db6d90e807b27a | 1,221 | py | Python | nativepython/type_wrappers/exceptions.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | nativepython/type_wrappers/exceptions.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | nativepython/type_wrappers/exceptions.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | # Coyright 2017-2019 Nativepython Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 39.387097 | 103 | 0.717445 |
bd003adbb7b859f141ee4c4c6b2319cd9594c072 | 13,183 | py | Python | openstack_dashboard/test/api_tests/vpnaas_tests.py | rtpro/horizon | 654724dccc3bf5d224eba10fa8f1e45ef7762c95 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/api_tests/vpnaas_tests.py | rtpro/horizon | 654724dccc3bf5d224eba10fa8f1e45ef7762c95 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/api_tests/vpnaas_tests.py | rtpro/horizon | 654724dccc3bf5d224eba10fa8f1e45ef7762c95 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013, Mirantis Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 44.840136 | 78 | 0.655996 |
bf2ab78ba51204bc38e00310ed0900cbe8d572de | 44,395 | py | Python | web/db.py | jackylee53/spiderproxypool | f9e298aa420baea0194da6176a3f1ef976a04c44 | [
"MIT"
] | null | null | null | web/db.py | jackylee53/spiderproxypool | f9e298aa420baea0194da6176a3f1ef976a04c44 | [
"MIT"
] | null | null | null | web/db.py | jackylee53/spiderproxypool | f9e298aa420baea0194da6176a3f1ef976a04c44 | [
"MIT"
] | null | null | null | """
Database API
(part of web.py)
"""
from __future__ import print_function
from .utils import threadeddict, storage, iters, iterbetter, safestr, safeunicode
import datetime, time, os, urllib, re
from .py3helpers import PY2, string_types, numeric_types, iteritems
try:
from urllib import parse as urlparse
from... | 34.045245 | 477 | 0.538326 |
8ad56120ef43809ad1e1f236241904bcc3d569b4 | 455 | py | Python | exercicio18.py | juniooor/Exercicios-python | aed87da4f93d0e6083b1a8c3af4081a028f145de | [
"MIT"
] | null | null | null | exercicio18.py | juniooor/Exercicios-python | aed87da4f93d0e6083b1a8c3af4081a028f145de | [
"MIT"
] | null | null | null | exercicio18.py | juniooor/Exercicios-python | aed87da4f93d0e6083b1a8c3af4081a028f145de | [
"MIT"
] | null | null | null | #Faça um programa que peça o tamanho de um arquivo para download (em MB) e a velocidade de um link de Internet (em Mbps), calcule e informe o tempo aproximado de download do arquivo usando este link (em minutos).
print('Tempo para download de arquivos')
mb=float(input('QUal o tamanho do arquivo em MB?: '))
net=float(i... | 56.875 | 212 | 0.738462 |
09aed436bc13f13e54344d69d8e1286d9bc00486 | 609 | py | Python | conary/repository/netrepos/__init__.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 43 | 2015-03-31T01:37:10.000Z | 2021-11-14T16:26:48.000Z | conary/repository/netrepos/__init__.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-06-10T16:39:41.000Z | 2020-01-27T16:35:01.000Z | conary/repository/netrepos/__init__.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-04-07T08:12:37.000Z | 2020-01-26T09:54:18.000Z | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 32.052632 | 74 | 0.743842 |
1f94ebf11f393920b3c0087d3a98a7fc065df974 | 4,760 | py | Python | lib/models/cifar_resnet.py | jeffreyzpan/adversarial-playground | 6df17e7b8b2e41bfbe5966006604805e199d2f87 | [
"MIT"
] | 21 | 2020-01-30T00:22:45.000Z | 2021-11-30T03:43:28.000Z | lib/models/cifar_resnet.py | jeffreyzpan/adversarial-playground | 6df17e7b8b2e41bfbe5966006604805e199d2f87 | [
"MIT"
] | 3 | 2020-01-12T06:02:11.000Z | 2020-06-05T17:55:13.000Z | lib/models/cifar_resnet.py | jeffreyzpan/adversarial-playground | 6df17e7b8b2e41bfbe5966006604805e199d2f87 | [
"MIT"
] | null | null | null | '''
Cifar ResNet implementation modified from https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Deep Residual Learning for Image Recognition. arXiv:1512.03385
'''
import torch
import torch.nn as nn
import torch.nn.functional as F... | 39.666667 | 112 | 0.651681 |
990cee2ea14dcc8f722d20cb8d904d1b84b5824d | 1,249 | py | Python | tests/test_inchi2gv.py | Midnighter/component-contribution | e580480a1979fa7b57b378c9a02a99f2f0b5bde6 | [
"MIT"
] | 1 | 2018-01-31T13:44:03.000Z | 2018-01-31T13:44:03.000Z | tests/test_inchi2gv.py | Midnighter/component-contribution | e580480a1979fa7b57b378c9a02a99f2f0b5bde6 | [
"MIT"
] | 19 | 2017-06-07T06:28:55.000Z | 2018-06-05T13:14:17.000Z | tests/test_inchi2gv.py | Midnighter/component-contribution | e580480a1979fa7b57b378c9a02a99f2f0b5bde6 | [
"MIT"
] | 1 | 2016-12-12T14:33:25.000Z | 2016-12-12T14:33:25.000Z | import sys
sys.path.append('../python')
import inchi2gv
from compound_cacher import CompoundCacher
from molecule import Molecule
#logger = logging.getLogger('')
#logger.setLevel(logging.DEBUG)
ccache = CompoundCacher('../cache/compounds.json')
groups_data = inchi2gv.init_groups_data()
group_list = groups_data.GetGroup... | 31.225 | 77 | 0.681345 |
6c84df373964059e728c72755ac83b10d2abd9b4 | 652 | py | Python | utils/environment.py | hbontempo-br/registration-validator-api | 7bb2b5cd7727e798bf0d4cd6c925cfec65dabff8 | [
"MIT"
] | null | null | null | utils/environment.py | hbontempo-br/registration-validator-api | 7bb2b5cd7727e798bf0d4cd6c925cfec65dabff8 | [
"MIT"
] | null | null | null | utils/environment.py | hbontempo-br/registration-validator-api | 7bb2b5cd7727e798bf0d4cd6c925cfec65dabff8 | [
"MIT"
] | null | null | null | import os
def get_environment_variable(variable_name: str, default_value: str = None):
"""
Gets an environment variable value, assuming the default value if it is not
already defined on the underlying operating system.
:param variable_name: Environment variable name.
:param default_value: Environ... | 34.315789 | 79 | 0.722393 |
2b338d680f8423fa7d68b15272cd4695b9d3ad0e | 21,294 | py | Python | ptflops/flops_counter.py | zamling/flops-counter.pytorch | c4d510659e20d4b9f1e597d4fae852b412a23d6a | [
"MIT"
] | null | null | null | ptflops/flops_counter.py | zamling/flops-counter.pytorch | c4d510659e20d4b9f1e597d4fae852b412a23d6a | [
"MIT"
] | null | null | null | ptflops/flops_counter.py | zamling/flops-counter.pytorch | c4d510659e20d4b9f1e597d4fae852b412a23d6a | [
"MIT"
] | null | null | null | '''
Copyright (C) 2019 Sovrasov V. - All Rights Reserved
* You may use, distribute and modify this code under the
* terms of the MIT license.
* You should have received a copy of the MIT license with
* this file. If not visit https://opensource.org/licenses/MIT
'''
import sys
from functools import partial
import ... | 35.196694 | 113 | 0.646238 |
9799fc23a5ed98da76d23f1e2c53f7c27002c8bc | 632 | py | Python | submission/insurancesubmission/migrations/0019_auto_20210714_2322.py | simonprast/wopi-engine | b3f59782659c8be42f4064bce5281afd391833be | [
"BSD-Source-Code"
] | null | null | null | submission/insurancesubmission/migrations/0019_auto_20210714_2322.py | simonprast/wopi-engine | b3f59782659c8be42f4064bce5281afd391833be | [
"BSD-Source-Code"
] | null | null | null | submission/insurancesubmission/migrations/0019_auto_20210714_2322.py | simonprast/wopi-engine | b3f59782659c8be42f4064bce5281afd391833be | [
"BSD-Source-Code"
] | null | null | null | # Generated by Django 3.1.2 on 2021-07-14 21:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('insurancesubmission', '0018_document_payment_document'),
]
operations = [
migrations.AddField(
model_name='insurancesubmission',... | 26.333333 | 73 | 0.617089 |
086f4c1b46f6a3c06f0ef148ac7664fe13f1c807 | 710 | py | Python | flask_mongoengine/wtf/models.py | corydolphin/flask-mongoengine | 689b10e6f17e8db4ec15fc87ed03e504bca757a2 | [
"BSD-3-Clause"
] | 2 | 2015-08-25T04:40:13.000Z | 2016-06-16T00:11:26.000Z | flask_mongoengine/wtf/models.py | corydolphin/flask-mongoengine | 689b10e6f17e8db4ec15fc87ed03e504bca757a2 | [
"BSD-3-Clause"
] | null | null | null | flask_mongoengine/wtf/models.py | corydolphin/flask-mongoengine | 689b10e6f17e8db4ec15fc87ed03e504bca757a2 | [
"BSD-3-Clause"
] | null | null | null | from flask.ext.wtf import Form
class ModelForm(Form):
"""A WTForms mongoengine model form"""
def __init__(self, formdata=None, obj=None, prefix='', **kwargs):
self.instance = (kwargs.pop('instance', None) or kwargs.get('obj', None))
if self.instance and not formdata:
obj = self.in... | 30.869565 | 81 | 0.614085 |
fa125eb50fa8a4d5f7f157395c2c0034edc9562e | 24,188 | py | Python | Lucky/src_Mike_GUI_Total/Lucky/Calculations.py | ruggiamp/Lucky | 9c89d2ae4129b3603da7d2c3f73b67995a23797a | [
"Apache-2.0"
] | null | null | null | Lucky/src_Mike_GUI_Total/Lucky/Calculations.py | ruggiamp/Lucky | 9c89d2ae4129b3603da7d2c3f73b67995a23797a | [
"Apache-2.0"
] | null | null | null | Lucky/src_Mike_GUI_Total/Lucky/Calculations.py | ruggiamp/Lucky | 9c89d2ae4129b3603da7d2c3f73b67995a23797a | [
"Apache-2.0"
] | null | null | null | '''
Created on 24 Nov 2015
@author: wnm24546
'''
from scipy.constants import c, h, k, pi
from scipy.optimize import curve_fit
from collections import OrderedDict
import numpy as np
from Lucky.LuckyExceptions import BadModelStateException
#k is kb
class CalculationService(object):
def __init__(self, pp):
... | 44.875696 | 205 | 0.587647 |
2a3c1367f712abaa3c0b7d5d90861fbe68671d2f | 1,019 | py | Python | web_dev/apps/test_model.py | tssahota/CMPT-732---Big-Data-Project | 27238543f0d62a0f2639317c042ab328b377cd63 | [
"Apache-2.0"
] | null | null | null | web_dev/apps/test_model.py | tssahota/CMPT-732---Big-Data-Project | 27238543f0d62a0f2639317c042ab328b377cd63 | [
"Apache-2.0"
] | null | null | null | web_dev/apps/test_model.py | tssahota/CMPT-732---Big-Data-Project | 27238543f0d62a0f2639317c042ab328b377cd63 | [
"Apache-2.0"
] | 1 | 2021-03-04T23:13:58.000Z | 2021-03-04T23:13:58.000Z | import sys
assert sys.version_info >= (3, 5) # make sure we have Python 3.5+
from pyspark.sql import SparkSession, functions, types, Row
spark = SparkSession.builder.appName('tmax model tester').getOrCreate()
assert spark.version >= '2.3' # make sure we have Spark 2.3+
spark.sparkContext.setLogLevel('WARN')
from pyspa... | 33.966667 | 88 | 0.7105 |
95420dfe6adae1898062a6daa14ec01ce135a468 | 4,022 | py | Python | tests/unit/resources/test_statistics.py | primitybio/cellengine-python-toolk | 1f9dd168f1f27e2beba69f02e340371190857b33 | [
"MIT"
] | 4 | 2021-01-12T17:03:37.000Z | 2021-12-16T13:23:57.000Z | tests/unit/resources/test_statistics.py | primitybio/cellengine-python-toolk | 1f9dd168f1f27e2beba69f02e340371190857b33 | [
"MIT"
] | 61 | 2021-01-11T05:27:16.000Z | 2022-03-08T01:50:09.000Z | tests/unit/resources/test_statistics.py | primitybio/cellengine-python-toolkit | 1f9dd168f1f27e2beba69f02e340371190857b33 | [
"MIT"
] | null | null | null | import json
import pytest
import responses
EXP_ID = "5d38a6f79fae87499999a74b"
@pytest.fixture(scope="module")
def statistic_response(experiment, statistics):
return statistics
@pytest.mark.usefixtures("block_request")
class TestStatistics:
@responses.activate
def test_should_get_statistics(self, clie... | 31.920635 | 86 | 0.577822 |
4c04db3d97fdbf5c5c21be44da5e9edd6c388629 | 35,866 | py | Python | dace/codegen/targets/xilinx.py | andreaskuster/dace | f2c16430543bb56c54a833beeb626b8c30967428 | [
"BSD-3-Clause"
] | null | null | null | dace/codegen/targets/xilinx.py | andreaskuster/dace | f2c16430543bb56c54a833beeb626b8c30967428 | [
"BSD-3-Clause"
] | null | null | null | dace/codegen/targets/xilinx.py | andreaskuster/dace | f2c16430543bb56c54a833beeb626b8c30967428 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import collections
import itertools
import os
import re
import numpy as np
import dace
from dace import registry, dtypes
from dace.config import Config
from dace.frontend import operations
from dace.sdfg import nodes
from dace.sdfg import find... | 44.224414 | 100 | 0.540122 |
0b75d5582d94244453d144d37690813f25e53bab | 1,612 | py | Python | src/poetry/vcs/git/system.py | yokomotod/poetry | 4838c9fe9645c62353be569a96765c693f03f1a3 | [
"MIT"
] | null | null | null | src/poetry/vcs/git/system.py | yokomotod/poetry | 4838c9fe9645c62353be569a96765c693f03f1a3 | [
"MIT"
] | null | null | null | src/poetry/vcs/git/system.py | yokomotod/poetry | 4838c9fe9645c62353be569a96765c693f03f1a3 | [
"MIT"
] | null | null | null | from __future__ import annotations
import subprocess
from typing import TYPE_CHECKING
from dulwich.client import find_git_command
if TYPE_CHECKING:
from pathlib import Path
from typing import Any
class SystemGit:
@classmethod
def clone(cls, repository: str, dest: Path) -> str:
cls._check_... | 24.424242 | 84 | 0.527295 |
2641ab438e7ea32df4e425792e560d5b18cb0d22 | 732 | py | Python | spectra/utilities.py | kristianeschenburg/spectra | 53304458a9cd265b40426f50d0aa7114627982d4 | [
"BSD-3-Clause"
] | null | null | null | spectra/utilities.py | kristianeschenburg/spectra | 53304458a9cd265b40426f50d0aa7114627982d4 | [
"BSD-3-Clause"
] | null | null | null | spectra/utilities.py | kristianeschenburg/spectra | 53304458a9cd265b40426f50d0aa7114627982d4 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
def filter(V, F, inds):
"""
Filter vertices and faces by list of indices.
Parameters:
- - - - -
V: float, array
x,y,z coordinates of the surface mesh
F: int, array
triangles of the surface mesh
inds: int, list
list of indices to keep
"""
... | 19.783784 | 50 | 0.505464 |
eb0fe5be64500d64bb0fa7519437215cf1559253 | 2,659 | py | Python | pysnmp/BENU-GENERAL-NOTIFICATION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/BENU-GENERAL-NOTIFICATION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/BENU-GENERAL-NOTIFICATION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module BENU-GENERAL-NOTIFICATION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BENU-GENERAL-NOTIFICATION-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:20:21 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ve... | 102.269231 | 493 | 0.790523 |
e0471af5fb00ef2667654c253c03b5f6a5bdeb5d | 6,521 | py | Python | gameboard.py | JP-DataScienceProjects/2048AI | 77901b01414da6e2edd74e5faca70fa8b0944f00 | [
"BSD-2-Clause"
] | 1 | 2018-03-28T07:51:10.000Z | 2018-03-28T07:51:10.000Z | gameboard.py | JP-DataScienceProjects/2048AI | 77901b01414da6e2edd74e5faca70fa8b0944f00 | [
"BSD-2-Clause"
] | null | null | null | gameboard.py | JP-DataScienceProjects/2048AI | 77901b01414da6e2edd74e5faca70fa8b0944f00 | [
"BSD-2-Clause"
] | 1 | 2018-11-06T01:53:50.000Z | 2018-11-06T01:53:50.000Z | import numpy as np
from enum import Enum
from zope.event import notify
class GameStates(Enum):
WIN = 1
LOSE = 2
IN_PROGRESS = 3
class GameActions(Enum):
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
class OnBoardChanged():
def __init__(self, board):
self.board = board
class GameBoard():... | 36.227778 | 145 | 0.571385 |
2944aeb90e665243ae19bfac98b0a3839691e11f | 58,727 | py | Python | tlrm2e/planet.py | LittleDevil0x29A/SectorGen | 5940bc6ea30279a5efac19e770ab635dac254a1c | [
"CC0-1.0"
] | null | null | null | tlrm2e/planet.py | LittleDevil0x29A/SectorGen | 5940bc6ea30279a5efac19e770ab635dac254a1c | [
"CC0-1.0"
] | null | null | null | tlrm2e/planet.py | LittleDevil0x29A/SectorGen | 5940bc6ea30279a5efac19e770ab635dac254a1c | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import argv,exit
from platform import system
import random
try:
from tools.db_parse import App as XML_Parse
except:
try:
from lib.tools.db_parse import App as XML_Parse
except ModuleNotFoundError:
from testing_tools.db_pars... | 47.284219 | 195 | 0.510327 |
28c4a8bf9bf00c45351a4a947775f78f55790bbf | 16,732 | py | Python | numba/cuda/api.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-08-10T05:33:29.000Z | 2021-08-10T05:33:29.000Z | numba/cuda/api.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | numba/cuda/api.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | """
API that are reported to numba.cuda
"""
import contextlib
import numpy as np
from .cudadrv import devicearray, devices, driver
# NDarray device helper
require_context = devices.require_context
current_context = devices.get_context
gpus = devices.gpus
@require_context
def from_cuda_array_interface(desc, own... | 32.679688 | 80 | 0.649235 |
f528f3eaa37e43021b01db52277bcdc759a353ae | 9,745 | py | Python | tests/unit/utils/network.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 2 | 2015-11-07T12:05:15.000Z | 2018-10-29T13:21:06.000Z | tests/unit/utils/network.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/network.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import skipIf
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, patch
ensure_in_syspath('../../')
# Imp... | 51.289474 | 107 | 0.491534 |
996b2f7b0cb4942d7b87d7efeca5ffcebe3681fb | 1,582 | py | Python | 2020/starter.py | iKevinY/advent | d160fb711a0a4d671f53cbd61088117e7ff0276a | [
"MIT"
] | 11 | 2019-12-03T06:32:37.000Z | 2021-12-24T12:23:57.000Z | 2020/starter.py | iKevinY/advent | d160fb711a0a4d671f53cbd61088117e7ff0276a | [
"MIT"
] | null | null | null | 2020/starter.py | iKevinY/advent | d160fb711a0a4d671f53cbd61088117e7ff0276a | [
"MIT"
] | 1 | 2019-12-07T06:21:31.000Z | 2019-12-07T06:21:31.000Z | import os # NOQA
import sys # NOQA
import re # NOQA
import math # NOQA
import copy # NOQA
import fileinput
from string import ascii_uppercase, ascii_lowercase # NOQA
from collections import Counter, defaultdict, deque, namedtuple # NOQA
from itertools import count, product, permutations, combinations, combinatio... | 35.954545 | 108 | 0.661188 |
57ee10d869e994c127818736544a8de71ae2f3b1 | 2,209 | py | Python | Videos/dataManagement/rootrelative.py | 93TEI/3D_Action_Recognition | b648f4cd8e479872c0cd9488120ada18bc64e5ad | [
"MIT"
] | 33 | 2018-05-22T08:35:59.000Z | 2021-10-06T09:56:07.000Z | Videos/dataManagement/rootrelative.py | 93TEI/3D_Action_Recognition | b648f4cd8e479872c0cd9488120ada18bc64e5ad | [
"MIT"
] | 2 | 2018-09-19T19:32:19.000Z | 2019-05-09T02:27:06.000Z | Videos/dataManagement/rootrelative.py | Naman-ntc/Action-Recognition | b648f4cd8e479872c0cd9488120ada18bc64e5ad | [
"MIT"
] | 5 | 2018-05-06T20:48:38.000Z | 2019-09-01T07:55:09.000Z | import numpy as np
import pickle
import torch
def f(a):
##array is 3d
##size is 300x25x3
#print(a.shape)
first = 0
last = 300
zeros = np.zeros((75, 1))
if not (a[299, :]==0).all():
return a
while (first<last):
middle = (first + last)//2
if (a[middle,:] == 0).all():
last = middle
else:
first = mi... | 25.988235 | 82 | 0.635129 |
7ced76bdb4f627a4b91ac83d6e8995761ca3bd85 | 9,780 | py | Python | isi_sdk_8_2_2/isi_sdk_8_2_2/models/dataset_filter_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/dataset_filter_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/dataset_filter_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_2.models.dataset... | 35.053763 | 205 | 0.617178 |
f2938ebae09335ecb17ac03fcdbcd51858d9b44a | 121,738 | py | Python | tensorflow/python/keras/layers/recurrent.py | carchrae/tensorflow | 6a69a6b2e286b14ac9ae813998bb0d78b6fee440 | [
"Apache-2.0"
] | 1 | 2020-06-21T23:30:57.000Z | 2020-06-21T23:30:57.000Z | tensorflow/python/keras/layers/recurrent.py | carchrae/tensorflow | 6a69a6b2e286b14ac9ae813998bb0d78b6fee440 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/layers/recurrent.py | carchrae/tensorflow | 6a69a6b2e286b14ac9ae813998bb0d78b6fee440 | [
"Apache-2.0"
] | 1 | 2020-08-28T07:24:37.000Z | 2020-08-28T07:24:37.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.310596 | 118 | 0.678408 |
b571d767f002a222289e9e96594642c37a8705d6 | 6,045 | py | Python | setup.py | ismlkrkmz/Dragonfire | 7a5e22bd07ba9734d68fe76ce77d80164d47249e | [
"MIT"
] | 1,320 | 2017-06-20T21:47:35.000Z | 2022-03-29T08:53:31.000Z | setup.py | ismlkrkmz/Dragonfire | 7a5e22bd07ba9734d68fe76ce77d80164d47249e | [
"MIT"
] | 120 | 2017-06-21T13:16:40.000Z | 2022-03-24T18:12:21.000Z | setup.py | ismlkrkmz/Dragonfire | 7a5e22bd07ba9734d68fe76ce77d80164d47249e | [
"MIT"
] | 229 | 2017-06-21T05:38:43.000Z | 2022-03-14T14:03:10.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages, Extension
# To use a consistent encoding
from c... | 32.326203 | 110 | 0.642514 |
dbbb8eb0219260520c944c613b41bffbf8fad6f8 | 2,454 | py | Python | app/scheduler/default_settings.py | ZoomerAnalytics/chronos | b4418b8be0c2d685533e5699c8d2d49344742365 | [
"BSD-2-Clause"
] | 2 | 2017-02-20T10:28:09.000Z | 2017-09-22T16:45:26.000Z | app/scheduler/default_settings.py | ZoomerAnalytics/chronos | b4418b8be0c2d685533e5699c8d2d49344742365 | [
"BSD-2-Clause"
] | null | null | null | app/scheduler/default_settings.py | ZoomerAnalytics/chronos | b4418b8be0c2d685533e5699c8d2d49344742365 | [
"BSD-2-Clause"
] | 3 | 2017-02-09T19:32:31.000Z | 2017-05-04T05:43:13.000Z | """Default settings."""
import logging
import os
#
# Development mode or production mode
# If DEBUG is True, then auto-reload is enabled, i.e., when code is modified, server will be
# reloaded immediately
#
DEBUG = True
#
# Static Assets
#
# The web UI is a single page app. All javascripts/css files should be in ST... | 25.040816 | 98 | 0.735126 |
4d55d0d30d5562fdaca9f9fea6a2697d32419a14 | 1,730 | py | Python | ThreadedPS.py | Rishit-dagli/Network-scanner-Python | 951e8caa0344a388a517250b3e2aac071eea03c3 | [
"Apache-2.0"
] | 1 | 2020-07-24T03:50:18.000Z | 2020-07-24T03:50:18.000Z | ThreadedPS.py | Rishit-dagli/Network-scanner-Python | 951e8caa0344a388a517250b3e2aac071eea03c3 | [
"Apache-2.0"
] | null | null | null | ThreadedPS.py | Rishit-dagli/Network-scanner-Python | 951e8caa0344a388a517250b3e2aac071eea03c3 | [
"Apache-2.0"
] | null | null | null | '''
Threaded Port Scanner 1.0.0:
A python code to demonstrate demonstrates a Threaded Port scanner built using Python 3.x
We here use threading to speed up the process
Note: Port scanning is dangerous, so you are advised to not to use
this script without permission
'''
__author__ = "Rishit Dagli"
__co... | 21.358025 | 89 | 0.641618 |
20eee3b38aea940ae6a0daefa4cfec0929fc21ea | 4,209 | py | Python | torchvision/datasets/omniglot.py | SliMM/vision | 101d19b9dec9b4a82ef6c3e2e1d7903e46369fd5 | [
"BSD-3-Clause"
] | 1 | 2020-11-17T07:13:18.000Z | 2020-11-17T07:13:18.000Z | torchvision/datasets/omniglot.py | SliMM/vision | 101d19b9dec9b4a82ef6c3e2e1d7903e46369fd5 | [
"BSD-3-Clause"
] | null | null | null | torchvision/datasets/omniglot.py | SliMM/vision | 101d19b9dec9b4a82ef6c3e2e1d7903e46369fd5 | [
"BSD-3-Clause"
] | 3 | 2020-12-17T22:32:06.000Z | 2022-03-23T01:43:42.000Z | from PIL import Image
from os.path import join
from typing import Any, Callable, List, Optional, Tuple
from .vision import VisionDataset
from .utils import download_and_extract_archive, check_integrity, list_dir, list_files
class Omniglot(VisionDataset):
"""`Omniglot <https://github.com/brendenlake/omniglot>`_ Da... | 42.94898 | 117 | 0.642195 |
38de62c8b825fa6b4c7b62c0820951439e41b21e | 286 | py | Python | tests/test_bulk_query.py | Jayzhanscar/SQLBatis | 28561b52f97d30f22b6500fc1be37a1d7cbea2ba | [
"MIT"
] | null | null | null | tests/test_bulk_query.py | Jayzhanscar/SQLBatis | 28561b52f97d30f22b6500fc1be37a1d7cbea2ba | [
"MIT"
] | null | null | null | tests/test_bulk_query.py | Jayzhanscar/SQLBatis | 28561b52f97d30f22b6500fc1be37a1d7cbea2ba | [
"MIT"
] | null | null | null | from tests.basic_test import BasicTestCase, db
from tests.crud import *
class BulkQueryTestCase(BasicTestCase):
def test_1_bulk_create(self):
bulk_create(users)
results = select()
assert len(results) == 2
if __name__ == '__main__':
unittest.main()
| 17.875 | 46 | 0.681818 |
acdcb9e288fecedce2cb2592f6fb676432e05afb | 348 | py | Python | Abbaize.py | fatih-iver/Intro-to-Computer-Science-with-Python | 7b8127681415dfd100a0e70fe8a672cec696bbb7 | [
"MIT"
] | null | null | null | Abbaize.py | fatih-iver/Intro-to-Computer-Science-with-Python | 7b8127681415dfd100a0e70fe8a672cec696bbb7 | [
"MIT"
] | null | null | null | Abbaize.py | fatih-iver/Intro-to-Computer-Science-with-Python | 7b8127681415dfd100a0e70fe8a672cec696bbb7 | [
"MIT"
] | null | null | null | # Define a procedure, abbaize, that takes
# two strings as its inputs, and returns
# a string that is the first input,
# followed by two repetitions of the second input,
# followed by the first input.
def abbaize(a, b):
return a + b + b + a
#print abbaize('a','b')
#>>> 'abba'
#print abbaize('dog'... | 21.75 | 51 | 0.637931 |
07a3b58f1d6e8b381ccae2bd4df7a0c2cd5fee00 | 2,769 | py | Python | atgql/shims.py | ATyped/atgql | 3fa9e09c9cea346dc42c205452487420ceb493e2 | [
"MIT"
] | null | null | null | atgql/shims.py | ATyped/atgql | 3fa9e09c9cea346dc42c205452487420ceb493e2 | [
"MIT"
] | null | null | null | atgql/shims.py | ATyped/atgql | 3fa9e09c9cea346dc42c205452487420ceb493e2 | [
"MIT"
] | null | null | null | __all__ = ['Promise', 'typeof']
import types
from collections.abc import Awaitable, Callable
from inspect import getmembers, isclass
from typing import Any, Literal, TypeVar
T = TypeVar('T')
Promise = Awaitable[T]
boolean_types = {bool}
number_types = {int, float, complex}
string_types = {str}
callable_types = set... | 32.964286 | 98 | 0.558685 |
ba153204cb6ef2a8ec467e147e20fe902be103e8 | 4,769 | py | Python | xmpush/base/APIMessage.py | ULHI-xin/xmpush-python | b88c75d7c5e2f10262a997f6d65ae1defe0af1b0 | [
"Apache-2.0"
] | 1 | 2020-03-10T00:54:26.000Z | 2020-03-10T00:54:26.000Z | xmpush/base/APIMessage.py | ULHI-xin/xmpush-python | b88c75d7c5e2f10262a997f6d65ae1defe0af1b0 | [
"Apache-2.0"
] | null | null | null | xmpush/base/APIMessage.py | ULHI-xin/xmpush-python | b88c75d7c5e2f10262a997f6d65ae1defe0af1b0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from xmpush.base.APIConstants import Constants
class MessageDict(dict):
def __getattr__(self, item):
try:
return self[item]
except KeyError:
raise AttributeError(r"'message' object has no attribute %s'" % item)
def __setattr__(self, key, value):
... | 28.728916 | 120 | 0.67121 |
688b47a858312c158dc6371fde27d9c793b7ff2e | 3,961 | py | Python | model/component.py | RxstydnR/LEA-Net | e163c614a1370b9ee3aba177ccc06b22837091b2 | [
"MIT"
] | null | null | null | model/component.py | RxstydnR/LEA-Net | e163c614a1370b9ee3aba177ccc06b22837091b2 | [
"MIT"
] | null | null | null | model/component.py | RxstydnR/LEA-Net | e163c614a1370b9ee3aba177ccc06b22837091b2 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.layers import Conv2D,Flatten,Dense,Lambda,BatchNormalization, Activation, GlobalAveragePooling2D
from tensorflow.keras.layers import Add, Multiply, Concatenate
from tensorflow.keras import backend as K
def conv_block(n_filter, x):
x = Conv2D(n_filter, kernel_size=... | 29.781955 | 119 | 0.591265 |
58acca784e9e8edd8436d767c33570a286b0db0a | 5,579 | py | Python | kubernetes/client/models/v2beta2_metric_value_status.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 2 | 2020-06-21T08:03:18.000Z | 2020-06-21T09:53:29.000Z | kubernetes/client/models/v2beta2_metric_value_status.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v2beta2_metric_value_status.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 1 | 2020-12-10T07:28:08.000Z | 2020-12-10T07:28:08.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.16
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V2bet... | 32.625731 | 213 | 0.625381 |
a57fdffa357424ff99aae449d5c51f0efb6304d2 | 3,532 | py | Python | Tutorials/TensorFlow_V1/examples/3_NeuralNetworks/recurrent_network.py | lev1khachatryan/ASDS_CV | c9f0c0412002e929bcb7cc2fc6e5392977a9fa76 | [
"MIT"
] | 5 | 2019-12-13T16:26:10.000Z | 2020-01-10T07:44:05.000Z | Tutorials/TensorFlow_V1/examples/3_NeuralNetworks/recurrent_network.py | lev1khachatryan/ASDS_CV | c9f0c0412002e929bcb7cc2fc6e5392977a9fa76 | [
"MIT"
] | 1 | 2020-01-07T16:48:21.000Z | 2020-03-18T18:43:37.000Z | Tutorials/TensorFlow_V1/examples/3_NeuralNetworks/recurrent_network.py | lev1khachatryan/ASDS_CV | c9f0c0412002e929bcb7cc2fc6e5392977a9fa76 | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib import rnn
# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
'''
To classify images using a recurrent neural network, we consider every imag... | 34.291262 | 81 | 0.689128 |
c23389cc7d45a8d1d2b83a5c7b5fc753995e3e1a | 4,854 | py | Python | external/scons-local-3.0.3/scons-local-3.0.3/SCons/Scanner/C.py | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | external/scons-local-3.0.3/scons-local-3.0.3/SCons/Scanner/C.py | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | external/scons-local-3.0.3/scons-local-3.0.3/SCons/Scanner/C.py | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | """SCons.Scanner.C
This module implements the dependency scanner for C/C++ code.
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software w... | 36.772727 | 116 | 0.650391 |
ebcac8bd03f8d36809232d96955e2d3d55cf5c22 | 3,992 | py | Python | detr2onnx.py | haozy008/detr_transformer | f2cca52a1ea97a31c9497451714373bb691589e9 | [
"Apache-2.0"
] | 22 | 2020-09-20T15:08:57.000Z | 2022-03-27T14:06:09.000Z | detr2onnx.py | haozy008/detr_transformer | f2cca52a1ea97a31c9497451714373bb691589e9 | [
"Apache-2.0"
] | 4 | 2020-12-16T15:52:13.000Z | 2021-08-14T02:40:07.000Z | detr2onnx.py | haozy008/detr_transformer | f2cca52a1ea97a31c9497451714373bb691589e9 | [
"Apache-2.0"
] | 7 | 2020-08-24T03:12:55.000Z | 2022-03-27T14:06:34.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import io
import unittest
import torch
from util.misc import nested_tensor_from_tensor_list
from hubconf import detr_resnet50, detr_resnet50_panoptic
# onnxruntime requires python 3.5 or above
try:
import onnxruntime
except ImportError:
on... | 38.384615 | 119 | 0.650301 |
129ce6021660afe594d02b612a04298fd9c09ec6 | 65 | py | Python | tests/app1.py | gilbrookie/cmdr | ee31e5b75a01f00e45f8181bf78017f232f0287e | [
"ISC"
] | null | null | null | tests/app1.py | gilbrookie/cmdr | ee31e5b75a01f00e45f8181bf78017f232f0287e | [
"ISC"
] | null | null | null | tests/app1.py | gilbrookie/cmdr | ee31e5b75a01f00e45f8181bf78017f232f0287e | [
"ISC"
] | null | null | null | #!/usr/bin/python
from data import CmdrSimple
CmdrSimple.start()
| 16.25 | 27 | 0.784615 |
62f871b3bfaf95541ac9faf7b4cc948a7dfd3355 | 6,288 | py | Python | relentless/data.py | mphoward/relentless | 5f7e8eb62696f45df28a948202b324563805a7f5 | [
"BSD-3-Clause"
] | null | null | null | relentless/data.py | mphoward/relentless | 5f7e8eb62696f45df28a948202b324563805a7f5 | [
"BSD-3-Clause"
] | 8 | 2019-12-19T21:27:25.000Z | 2019-12-20T02:47:00.000Z | relentless/data.py | mphoward/relentless | 5f7e8eb62696f45df28a948202b324563805a7f5 | [
"BSD-3-Clause"
] | null | null | null | """
Data management
===============
The :class:`Directory` class provides an interface for creating hierarchical
filesystem directories and files within those directories using either an absolute
or relative path.
.. autosummary::
:nosignatures:
Directory
.. autoclass:: Directory
:members:
"""
import os... | 26.757447 | 83 | 0.566476 |
c7b559c04142bfeba26ddab4738ba5da0b7c8454 | 7,629 | py | Python | Iirc.EnergyLimitsScheduling.Shared/python/vizualization/gantt.py | CTU-IIG/EnergyLimitsScheduling | 4046c5d6f2a6ff39de0a80665a64666938b0928b | [
"MIT"
] | null | null | null | Iirc.EnergyLimitsScheduling.Shared/python/vizualization/gantt.py | CTU-IIG/EnergyLimitsScheduling | 4046c5d6f2a6ff39de0a80665a64666938b0928b | [
"MIT"
] | null | null | null | Iirc.EnergyLimitsScheduling.Shared/python/vizualization/gantt.py | CTU-IIG/EnergyLimitsScheduling | 4046c5d6f2a6ff39de0a80665a64666938b0928b | [
"MIT"
] | null | null | null | from typing import Tuple, List, Dict, Optional
import matplotlib
matplotlib.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
matplotlib.rc('text', usetex=True)
matplotlib.rc('text.latex', preamble=r'\usepackage{amsmath}')
import numpy as np
import matplotlib.pyplot as plt
import struct
from matplotlib.p... | 33.460526 | 113 | 0.621051 |
f963005ec0cd36e19b5190a0b14d7954cb59e026 | 339 | py | Python | skfftw/__init__.py | ghisvail/scikit-fftw | 98dd33250794405e4d983c34ccbf27d27572a75b | [
"BSD-3-Clause"
] | null | null | null | skfftw/__init__.py | ghisvail/scikit-fftw | 98dd33250794405e4d983c34ccbf27d27572a75b | [
"BSD-3-Clause"
] | null | null | null | skfftw/__init__.py | ghisvail/scikit-fftw | 98dd33250794405e4d983c34ccbf27d27572a75b | [
"BSD-3-Clause"
] | null | null | null | # coding: utf8
# Copyright (c) 2014, 2015 Ghislain Antony Vaillant.
#
# This file is distributed under the new BSD License, see the LICENSE file or
# checkout the license terms at http://opensource.org/licenses/BSD-3-Clause).
from __future__ import absolute_import, division, print_function
from .version import VERS... | 30.818182 | 78 | 0.781711 |
1742a0a5d6ce46ec86276eed7f389dfa7d3c3e89 | 2,773 | py | Python | homeassistant/components/abode/camera.py | billyburly/home-assistant | 9795449d22783e77a0ca7b745f15c89a830c5cc6 | [
"Apache-2.0"
] | 5 | 2020-09-17T10:48:51.000Z | 2021-11-22T00:08:17.000Z | homeassistant/components/abode/camera.py | billyburly/home-assistant | 9795449d22783e77a0ca7b745f15c89a830c5cc6 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/components/abode/camera.py | billyburly/home-assistant | 9795449d22783e77a0ca7b745f15c89a830c5cc6 | [
"Apache-2.0"
] | 2 | 2019-07-05T17:46:08.000Z | 2021-04-25T21:21:02.000Z | """Support for Abode Security System cameras."""
from datetime import timedelta
import logging
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
import requests
from homeassistant.components.camera import Camera
from homeassistant.helpers.dispatcher import async_dispatcher_connect
... | 29.817204 | 82 | 0.670754 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.