hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3dcf3bfe9eada9f0685932fa73f16baeaacef1 | 61,254 | py | Python | src/fractalshades/numpy_utils/xrange.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | 3 | 2021-03-06T18:32:51.000Z | 2021-07-07T01:35:21.000Z | src/fractalshades/numpy_utils/xrange.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | null | null | null | src/fractalshades/numpy_utils/xrange.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import numbers
import re
import mpmath
#import time
def mpc_to_Xrange(mpc, dtype=np.complex128):
""" Convert a mpc complex to a Xrange array"""
select = {np.dtype(np.complex64): np.float32,
np.dtype(np.complex128): np.float64}
float_type = select[np... | 37.078692 | 90 | 0.53794 |
import numpy as np
import numbers
import re
import mpmath
def mpc_to_Xrange(mpc, dtype=np.complex128):
select = {np.dtype(np.complex64): np.float32,
np.dtype(np.complex128): np.float64}
float_type = select[np.dtype(dtype)]
mpcx_m, mpcx_exp = mpmath.frexp(mpc.real)
mpcy_m, mpcy_exp = mp... | true | true |
1c3dcf5f0db8ed6f4e869f0a7cb6a9d75717fd57 | 1,903 | py | Python | nemo/collections/nlp/utils/data_utils.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 1 | 2020-08-04T08:29:41.000Z | 2020-08-04T08:29:41.000Z | nemo/collections/nlp/utils/data_utils.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 1 | 2020-06-11T00:54:42.000Z | 2020-06-11T00:54:42.000Z | nemo/collections/nlp/utils/data_utils.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 3 | 2020-03-10T05:10:07.000Z | 2020-12-08T01:33:35.000Z | # =============================================================================
# Copyright 2020 NVIDIA. 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://ww... | 28.402985 | 94 | 0.629532 |
import re
import string
import numpy as np
__all__ = ['get_vocab', 'get_tokens', 'normalize_answer', 'mask_padded_tokens', 'concatenate']
def get_vocab(file):
lines = open(file, 'r').readlines()
lines = [line.strip() for line in lines if line.strip()]
labels = {i: lines[i] for i in range... | true | true |
1c3dd10dfb0fa34f4e3010248616dabec1be1074 | 385 | py | Python | Week 08/SLU14 - Modules & Packages/shapes/circle.py | LDSSA/ds-prep-course-2021 | 324f5302ade92d49eb199bdf2a93705142178c42 | [
"MIT"
] | 34 | 2021-03-28T15:59:41.000Z | 2022-03-22T09:20:45.000Z | Week 8/SLU14 - Modules & Packages/shapes/circle.py | RicSegundo/ds-prep-course | 75a9a8ff11628c07d37094d8f15026e318ac5834 | [
"MIT"
] | 52 | 2021-03-15T19:02:22.000Z | 2021-07-20T20:35:05.000Z | Week 8/SLU14 - Modules & Packages/shapes/circle.py | RicSegundo/ds-prep-course | 75a9a8ff11628c07d37094d8f15026e318ac5834 | [
"MIT"
] | 36 | 2020-03-21T12:44:08.000Z | 2021-04-02T21:56:32.000Z | import math
class Circle:
def __init__(self, radius):
self.radius = radius
def get_area(self):
return math.pi*math.sqrt(self.radius)
def get_perimeter(self):
return 2*math.pi*self.radius
if __name__ == "__main__":
obj_circle = Circle(20)
print("Area is {} and perimeter i... | 22.647059 | 101 | 0.65974 | import math
class Circle:
def __init__(self, radius):
self.radius = radius
def get_area(self):
return math.pi*math.sqrt(self.radius)
def get_perimeter(self):
return 2*math.pi*self.radius
if __name__ == "__main__":
obj_circle = Circle(20)
print("Area is {} and perimeter i... | true | true |
1c3dd1c08dc255e9cca291432b4a665fcfe39414 | 186 | py | Python | read.py | alexkreidler/pg2arrow | 0081f558616091689e7fdb0088ae86a820df27b7 | [
"BSD-2-Clause"
] | null | null | null | read.py | alexkreidler/pg2arrow | 0081f558616091689e7fdb0088ae86a820df27b7 | [
"BSD-2-Clause"
] | null | null | null | read.py | alexkreidler/pg2arrow | 0081f558616091689e7fdb0088ae86a820df27b7 | [
"BSD-2-Clause"
] | null | null | null | from json import load
import pyarrow as pa
with pa.memory_map('limited.arrow', 'r') as source:
loaded_arrays = pa.ipc.open_file(source).read_all()
print(loaded_arrays[0].schema) | 31 | 55 | 0.741935 | from json import load
import pyarrow as pa
with pa.memory_map('limited.arrow', 'r') as source:
loaded_arrays = pa.ipc.open_file(source).read_all()
print(loaded_arrays[0].schema) | true | true |
1c3dd2adda3a3f2416d3fe159d9ecd9479d9f5d0 | 144,878 | py | Python | build/django/tests/queries/tests.py | cntnboys/410Lab6 | cc5632bdaa9150e17c4df1bd989b5da36896492a | [
"Apache-2.0"
] | null | null | null | build/django/tests/queries/tests.py | cntnboys/410Lab6 | cc5632bdaa9150e17c4df1bd989b5da36896492a | [
"Apache-2.0"
] | null | null | null | build/django/tests/queries/tests.py | cntnboys/410Lab6 | cc5632bdaa9150e17c4df1bd989b5da36896492a | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from collections import OrderedDict
import datetime
from operator import attrgetter
import pickle
import unittest
import warnings
from django.core.exceptions import FieldError
from django.db import connection, DEFAULT_DB_ALIAS
from django.db.models import Count, F, Q
from djang... | 41.981455 | 159 | 0.615042 | from __future__ import unicode_literals
from collections import OrderedDict
import datetime
from operator import attrgetter
import pickle
import unittest
import warnings
from django.core.exceptions import FieldError
from django.db import connection, DEFAULT_DB_ALIAS
from django.db.models import Count, F, Q
from djang... | true | true |
1c3dd361de0c385a96d545cad4af4dcdbd3d1ea3 | 1,436 | py | Python | covid_update/descarga.py | jmbarrios/covid-mexico-19 | 6872d55830e2a6cd6987a4ee517cd016dd853edf | [
"MIT"
] | null | null | null | covid_update/descarga.py | jmbarrios/covid-mexico-19 | 6872d55830e2a6cd6987a4ee517cd016dd853edf | [
"MIT"
] | null | null | null | covid_update/descarga.py | jmbarrios/covid-mexico-19 | 6872d55830e2a6cd6987a4ee517cd016dd853edf | [
"MIT"
] | 2 | 2020-05-11T15:32:31.000Z | 2020-05-13T19:12:20.000Z | import os
import tempfile
from zipfile import ZipFile
import requests
from django.conf import settings
def descargar_datos():
directorio = os.path.join(
settings.BASE_DIR,
settings.DATOS_BASE_DIR,
settings.CASOS_DIR)
url = settings.DATOS_URL
return descargar_zip(url, directorio)
... | 26.592593 | 66 | 0.693593 | import os
import tempfile
from zipfile import ZipFile
import requests
from django.conf import settings
def descargar_datos():
directorio = os.path.join(
settings.BASE_DIR,
settings.DATOS_BASE_DIR,
settings.CASOS_DIR)
url = settings.DATOS_URL
return descargar_zip(url, directorio)
... | true | true |
1c3dd4edbc576b76ac8c096d634d365ed849fa77 | 11,656 | py | Python | lib/jnpr/junos/factory/table.py | a-v-popov/py-junos-eznc | fc5debc6ff181f7a4c83780b5981dd89394f7c92 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2016-02-23T09:49:46.000Z | 2019-06-18T15:59:01.000Z | lib/jnpr/junos/factory/table.py | a-v-popov/py-junos-eznc | fc5debc6ff181f7a4c83780b5981dd89394f7c92 | [
"Apache-2.0",
"BSD-3-Clause"
] | 12 | 2017-11-09T09:49:03.000Z | 2018-01-08T09:50:54.000Z | lib/jnpr/junos/factory/table.py | a-v-popov/py-junos-eznc | fc5debc6ff181f7a4c83780b5981dd89394f7c92 | [
"Apache-2.0",
"BSD-3-Clause"
] | 4 | 2015-05-13T11:05:42.000Z | 2017-11-09T09:32:07.000Z | # stdlib
from inspect import isclass
from time import time
from datetime import datetime
import os
# 3rd-party
from lxml import etree
import json
from jnpr.junos.factory.to_json import TableJSONEncoder
_TSFMT = "%Y%m%d%H%M%S"
class Table(object):
ITEM_XPATH = None
ITEM_NAME_XPATH = "name"
VIEW = None
... | 33.590778 | 88 | 0.497512 |
from inspect import isclass
from time import time
from datetime import datetime
import os
from lxml import etree
import json
from jnpr.junos.factory.to_json import TableJSONEncoder
_TSFMT = "%Y%m%d%H%M%S"
class Table(object):
ITEM_XPATH = None
ITEM_NAME_XPATH = "name"
VIEW = None
USE_FILTER = Non... | true | true |
1c3dd5494eb32c38208a97e80d557b824ec07768 | 9,836 | py | Python | l0bnb/tree.py | jonathan-taylor/l0bnb | 0c2beef67b92861ec51bc3514d485eabad43c611 | [
"MIT"
] | 25 | 2020-04-14T00:32:04.000Z | 2022-03-23T11:49:06.000Z | l0bnb/tree.py | jonathan-taylor/l0bnb | 0c2beef67b92861ec51bc3514d485eabad43c611 | [
"MIT"
] | 1 | 2021-10-12T16:37:04.000Z | 2021-10-12T16:37:04.000Z | l0bnb/tree.py | jonathan-taylor/l0bnb | 0c2beef67b92861ec51bc3514d485eabad43c611 | [
"MIT"
] | 9 | 2020-05-14T04:15:44.000Z | 2022-03-04T14:58:25.000Z | import time
import queue
import sys
from collections import namedtuple
import numpy as np
from .node import Node, upper_bound_solve
from .utilities import branch, is_integral
class BNBTree:
def __init__(self, x, y, int_tol=1e-4, rel_tol=1e-4):
"""
Initiate a BnB Tree to solve the least squares r... | 38.124031 | 79 | 0.536499 | import time
import queue
import sys
from collections import namedtuple
import numpy as np
from .node import Node, upper_bound_solve
from .utilities import branch, is_integral
class BNBTree:
def __init__(self, x, y, int_tol=1e-4, rel_tol=1e-4):
self.x = x
self.y = y
self.int_tol = int_tol... | true | true |
1c3dd5ce171bcf7a85412e446ef7691580a41b84 | 1,748 | py | Python | python-fundamentals/day-2-StringFormatting/string-formatting-method2.py | laminsawo/python-365-days | 7d63e88ad2bbaa7b9bd0475f078e0164cc9b485c | [
"MIT"
] | null | null | null | python-fundamentals/day-2-StringFormatting/string-formatting-method2.py | laminsawo/python-365-days | 7d63e88ad2bbaa7b9bd0475f078e0164cc9b485c | [
"MIT"
] | 1 | 2020-01-06T00:28:32.000Z | 2020-01-06T00:28:32.000Z | python-fundamentals/day-2-StringFormatting/string-formatting-method2.py | laminsawo/python-365-days | 7d63e88ad2bbaa7b9bd0475f078e0164cc9b485c | [
"MIT"
] | 1 | 2020-06-11T19:01:53.000Z | 2020-06-11T19:01:53.000Z |
"""
s = format as string
d = format as integer
f = format as floating number
"""
laptop = "Apple"
cost = 1200
exchange_rate = 1.2333322
# {place-holder: format}
# Apple has position of 0, cost has position of 1, and exchange rate has position of 2
print("The price of this {0:s} laptop is £{1:d} and th... | 54.625 | 121 | 0.613272 |
laptop = "Apple"
cost = 1200
exchange_rate = 1.2333322
print("The price of this {0:s} laptop is £{1:d} and the exchange rate is {2:f}".format(laptop, cost, exchange_rate))
print("The price of this {0:s} laptop is £{1:d} and the exchange rate is {2:.2f}".format(laptop, cost, exchange_rate))
print("The price... | true | true |
1c3dd760ae4a1a49af78765692ee990beb9871b7 | 13,724 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200501/get_vpn_server_configuration.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20200501/get_vpn_server_configuration.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20200501/get_vpn_server_configuration.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... | 45.594684 | 488 | 0.708321 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetVpnServerConfigurationResult',
'AwaitableGetVpnServerConfigurationResult',
'get_vpn_server_configuration',
]
@pulumi.... | true | true |
1c3dd7f845330b8240ef81d6a32014e2670c688b | 1,320 | py | Python | disturbance/components/organisations/admin.py | wilsonc86/ledger | a60a681e547f37e4ac81cb93dffaf90aea8c8151 | [
"Apache-2.0"
] | null | null | null | disturbance/components/organisations/admin.py | wilsonc86/ledger | a60a681e547f37e4ac81cb93dffaf90aea8c8151 | [
"Apache-2.0"
] | 11 | 2019-03-19T02:03:11.000Z | 2019-05-31T07:20:59.000Z | disturbance/components/organisations/admin.py | dbca-dragon/ledger | 6f71699e21c8e502ee805cadc82ee0ec4c004e79 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from ledger.accounts.models import EmailUser
from disturbance.components.organisations import models
from django.contrib.admin import actions
# Register your models here.
@admin.register(models.Organisation)
class OrganisationAdmin(admin.ModelAdmin):
list_display = ['organisation',... | 38.823529 | 110 | 0.743182 | from django.contrib import admin
from ledger.accounts.models import EmailUser
from disturbance.components.organisations import models
from django.contrib.admin import actions
@admin.register(models.Organisation)
class OrganisationAdmin(admin.ModelAdmin):
list_display = ['organisation','pin_one', 'pin_two']
re... | true | true |
1c3dd878b742bb0574276900dfb4d955ea152b48 | 1,053 | py | Python | socless/utils.py | Kerl1310/socless_python | 95c6146b2c88e1a929eaa708a9dede20fbc347a4 | [
"Apache-2.0"
] | null | null | null | socless/utils.py | Kerl1310/socless_python | 95c6146b2c88e1a929eaa708a9dede20fbc347a4 | [
"Apache-2.0"
] | null | null | null | socless/utils.py | Kerl1310/socless_python | 95c6146b2c88e1a929eaa708a9dede20fbc347a4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Twilio, 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, ... | 27 | 74 | 0.705603 |
import uuid
from datetime import datetime
def gen_id(limit=36):
return str(uuid.uuid4())[:limit]
def gen_datetimenow():
return datetime.utcnow().isoformat() + "Z"
| true | true |
1c3dd936dc0b6e4b503067c3190da9528c7c55dd | 17,466 | py | Python | modify_annovar.py | lshzhang/OTA-pipeline | fa69a5f85bc80add1e1f74f1d74ce1a233e114b8 | [
"Zlib"
] | null | null | null | modify_annovar.py | lshzhang/OTA-pipeline | fa69a5f85bc80add1e1f74f1d74ce1a233e114b8 | [
"Zlib"
] | null | null | null | modify_annovar.py | lshzhang/OTA-pipeline | fa69a5f85bc80add1e1f74f1d74ce1a233e114b8 | [
"Zlib"
] | 1 | 2021-08-14T04:10:18.000Z | 2021-08-14T04:10:18.000Z | #!/usr/bin/python
import csv
import vcf
import regex
import math
import sys, getopt
#using pandas for ease of merging columns to tsv files
import pandas as pd
#from dns.tokenizer import DELIMITER
def main(argv):
global inputfile
global outputfile
global vcffile
global pipeline
global consensus_... | 49.338983 | 298 | 0.60947 |
import csv
import vcf
import regex
import math
import sys, getopt
import pandas as pd
def main(argv):
global inputfile
global outputfile
global vcffile
global pipeline
global consensus_refseq_csv
try:
opts, args = getopt.getopt(argv,"hi:o:v:p:c:",["ifile=","ofile=","vcffile=","pi... | false | true |
1c3dd9d5b982877eb9b2e78a83f7d73bb12ce738 | 4,569 | py | Python | models/ResEVANet_v4.py | cankucuksozen/COMP551--ComputerVision-with-DL | 44c4510a7163ad4bcf00ce0e9d112ae1ba59b143 | [
"MIT"
] | null | null | null | models/ResEVANet_v4.py | cankucuksozen/COMP551--ComputerVision-with-DL | 44c4510a7163ad4bcf00ce0e9d112ae1ba59b143 | [
"MIT"
] | null | null | null | models/ResEVANet_v4.py | cankucuksozen/COMP551--ComputerVision-with-DL | 44c4510a7163ad4bcf00ce0e9d112ae1ba59b143 | [
"MIT"
] | null | null | null | """
ResNet + Expanding Visual Attention (ResEVANet) for CIFAR10 Image Classification.
ResNet backbone is adopted from Yerlan Idelbayev's implementation,
accessed at: https://github.com/akamaster/pytorch_ResNet_cifar10/blob/master/ResNet.py
by Can Küçüksözen
"""
import torch
import torch.nn as nn
import torch.nn.... | 29.862745 | 120 | 0.612607 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
from layers.expandVisAttn_v4.expandVisAttn3_7_v4 import expandVisAttn3_7
__all__ = ['ResEVANet', 'ResEVANet20', 'ResEVANet32', 'ResEVANet44', 'ResEVANet56', 'ResEVANet110', 'ResEVANe... | true | true |
1c3ddaae3fe121c87354bcd3992a74f10c1bbeb1 | 1,527 | py | Python | winsspi/utils/ldap3_gssapi_patch.py | skelsec/winsspi | 94ee686053908774069335e38ff4f39f27ada8dc | [
"MIT"
] | 13 | 2019-03-07T14:50:23.000Z | 2021-08-14T14:27:03.000Z | winsspi/utils/ldap3_gssapi_patch.py | skelsec/winsspi | 94ee686053908774069335e38ff4f39f27ada8dc | [
"MIT"
] | 1 | 2020-03-27T10:13:28.000Z | 2020-03-27T10:13:28.000Z | winsspi/utils/ldap3_gssapi_patch.py | skelsec/winsspi | 94ee686053908774069335e38ff4f39f27ada8dc | [
"MIT"
] | 4 | 2019-02-23T18:33:09.000Z | 2020-05-15T01:59:40.000Z | from minikerberos.sspi.kerberosspi import KerberosSSPI, SSPIResult
from ldap3.protocol.sasl.sasl import send_sasl_negotiation, abort_sasl_negotiation
import socket
def sasl_gssapi(connection, controls):
print('MONKEY!')
print(connection)
print(controls)
target_name = None
authz_id = b""
raw_creds = None
cre... | 32.489362 | 82 | 0.747872 | from minikerberos.sspi.kerberosspi import KerberosSSPI, SSPIResult
from ldap3.protocol.sasl.sasl import send_sasl_negotiation, abort_sasl_negotiation
import socket
def sasl_gssapi(connection, controls):
print('MONKEY!')
print(connection)
print(controls)
target_name = None
authz_id = b""
raw_creds = None
cre... | true | true |
1c3ddb1960991927d108aa95bfbcf63e207d85f0 | 203 | py | Python | gia_events/gia_events/doctype/speaker_form/speaker_form.py | the-bantoo/GIA-Global-Events | 5b3da47fdb9778bb388d611c77e04ee8747db6f8 | [
"MIT"
] | null | null | null | gia_events/gia_events/doctype/speaker_form/speaker_form.py | the-bantoo/GIA-Global-Events | 5b3da47fdb9778bb388d611c77e04ee8747db6f8 | [
"MIT"
] | null | null | null | gia_events/gia_events/doctype/speaker_form/speaker_form.py | the-bantoo/GIA-Global-Events | 5b3da47fdb9778bb388d611c77e04ee8747db6f8 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Bantoo Accounting and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class SpeakerForm(Document):
pass
| 22.555556 | 56 | 0.79803 |
from frappe.model.document import Document
class SpeakerForm(Document):
pass
| true | true |
1c3ddd9bc4360810fc5af17352303a8714378b5e | 546 | py | Python | test/python/visualization/__init__.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 22 | 2019-08-15T04:39:15.000Z | 2022-03-06T05:17:04.000Z | test/python/visualization/__init__.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 4 | 2019-05-13T15:28:46.000Z | 2019-12-19T20:47:02.000Z | test/python/visualization/__init__.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 9 | 2019-09-05T05:33:00.000Z | 2021-10-09T16:04:53.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 34.125 | 77 | 0.736264 | true | true | |
1c3dde5532276b413dd243da3e87cec978e21524 | 18,803 | py | Python | exact_solvers/acoustics_demos.py | katrinleinweber/riemann_book | 0bd2320765a459249d938c6913cc39339cddb3fb | [
"BSD-3-Clause"
] | null | null | null | exact_solvers/acoustics_demos.py | katrinleinweber/riemann_book | 0bd2320765a459249d938c6913cc39339cddb3fb | [
"BSD-3-Clause"
] | null | null | null | exact_solvers/acoustics_demos.py | katrinleinweber/riemann_book | 0bd2320765a459249d938c6913cc39339cddb3fb | [
"BSD-3-Clause"
] | null | null | null | """
Additional functions and demos for acoustics equations.
"""
from clawpack import pyclaw
from clawpack import riemann
from matplotlib import animation
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
from ipywidgets import widgets, interact
from IPython.display import display... | 40.349785 | 114 | 0.61453 | from clawpack import pyclaw
from clawpack import riemann
from matplotlib import animation
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
from ipywidgets import widgets, interact
from IPython.display import display
import sys
sys.path.append('../utils')
from utils import rieman... | true | true |
1c3ddea1fdb0257b48f8bd38591ead6a99fa5151 | 5,600 | py | Python | denoising.py | ozgurkara99/ISNAS-DIP | bfe3c41459f8803de552a2549266074b84fe1e17 | [
"MIT"
] | 6 | 2022-03-28T19:00:17.000Z | 2022-03-31T19:30:52.000Z | denoising.py | ozgurkara99/ISNAS-DIP | bfe3c41459f8803de552a2549266074b84fe1e17 | [
"MIT"
] | null | null | null | denoising.py | ozgurkara99/ISNAS-DIP | bfe3c41459f8803de552a2549266074b84fe1e17 | [
"MIT"
] | null | null | null | import argparse
import warnings
warnings.filterwarnings("ignore")
import torch
import torch.optim as optim
torch.backends.cudnn.enabled = True
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.deterministic = True
import utils.funcs as fn
import utils.basic_utils as bu
import utils.image_utils as i... | 30.939227 | 88 | 0.650536 | import argparse
import warnings
warnings.filterwarnings("ignore")
import torch
import torch.optim as optim
torch.backends.cudnn.enabled = True
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.deterministic = True
import utils.funcs as fn
import utils.basic_utils as bu
import utils.image_utils as i... | true | true |
1c3ddf686a055a85019d69299232396b150b648f | 1,869 | py | Python | K-Means Clustering in Python/friend-of-the-bank.py | debug314/coursework | beb732d0d06b5a338ba8115d59ed1c75edbb1bdb | [
"BSD-3-Clause"
] | null | null | null | K-Means Clustering in Python/friend-of-the-bank.py | debug314/coursework | beb732d0d06b5a338ba8115d59ed1c75edbb1bdb | [
"BSD-3-Clause"
] | null | null | null | K-Means Clustering in Python/friend-of-the-bank.py | debug314/coursework | beb732d0d06b5a338ba8115d59ed1c75edbb1bdb | [
"BSD-3-Clause"
] | null | null | null | # Foundations of Data Science: K-Means Clustering in Python
# by University of London & Goldsmiths, Coursera
# Week 5: A Data Clustering Project
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patch
from sklearn.cluster import KMeans
# V1. Variance of Wavelet Trans... | 24.92 | 93 | 0.688068 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patch
from sklearn.cluster import KMeans
df = pd.read_csv('files/banknote-authentication.csv')
no_of_clusters = 2
clustered = KMeans(n_clusters=no_of_clusters).fit(df)
k_means = clustered.cluster_centers_
k_la... | true | true |
1c3ddfbfc34418740f119f97361c08eeda52cba6 | 3,759 | py | Python | kobart/utils.py | sulungsLim/KoBART | 9bb9ea3143ecd407428897e6a9b3d1e14042787c | [
"MIT"
] | null | null | null | kobart/utils.py | sulungsLim/KoBART | 9bb9ea3143ecd407428897e6a9b3d1e14042787c | [
"MIT"
] | null | null | null | kobart/utils.py | sulungsLim/KoBART | 9bb9ea3143ecd407428897e6a9b3d1e14042787c | [
"MIT"
] | 1 | 2021-12-07T01:59:21.000Z | 2021-12-07T01:59:21.000Z | # coding=utf-8
# Modified MIT License
# Software Copyright (c) 2020 SK telecom
# 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 without restriction,
# including without limitation the rights t... | 42.235955 | 106 | 0.649641 |
import os
import sys
import requests
import hashlib
from zipfile import ZipFile
from transformers import PreTrainedTokenizerFast
tokenizer = {
'url':
'https://kobert.blob.core.windows.net/models/kobart/kobart_base_tokenizer_cased_a432df8fec.zip',
'fname': 'kobart_base_tokenizer_cased... | true | true |
1c3de08e891050fa23299ea86b3e843612abc738 | 610 | py | Python | migrations/2017_06_07_133517_create_files_table.py | alanjimenez1/qualibrate-api | d005e35029303ac9dfd8e66cb09c79393a472cad | [
"MIT"
] | null | null | null | migrations/2017_06_07_133517_create_files_table.py | alanjimenez1/qualibrate-api | d005e35029303ac9dfd8e66cb09c79393a472cad | [
"MIT"
] | null | null | null | migrations/2017_06_07_133517_create_files_table.py | alanjimenez1/qualibrate-api | d005e35029303ac9dfd8e66cb09c79393a472cad | [
"MIT"
] | null | null | null | from orator.migrations import Migration
class CreateFilesTable(Migration):
def up(self):
"""
Run the migrations.
"""
with self.schema.create('files') as table:
table.increments('id')
table.string('uuid')
table.string('name')
table.st... | 24.4 | 65 | 0.52459 | from orator.migrations import Migration
class CreateFilesTable(Migration):
def up(self):
with self.schema.create('files') as table:
table.increments('id')
table.string('uuid')
table.string('name')
table.string('path')
table.string('mime')
... | true | true |
1c3de0a8162572462a5485b734fecb83efc1c1c9 | 116 | py | Python | run_dev.py | LandRegistry/property-frontend-alpha | bde928c802a7efd8a0e18c041341e54d4cc89bc1 | [
"MIT"
] | null | null | null | run_dev.py | LandRegistry/property-frontend-alpha | bde928c802a7efd8a0e18c041341e54d4cc89bc1 | [
"MIT"
] | null | null | null | run_dev.py | LandRegistry/property-frontend-alpha | bde928c802a7efd8a0e18c041341e54d4cc89bc1 | [
"MIT"
] | 1 | 2021-04-11T06:06:39.000Z | 2021-04-11T06:06:39.000Z | from propertyfrontend.server import app
import os
app.run(host="0.0.0.0", port=int(os.environ['PORT']), debug=True)
| 29 | 65 | 0.741379 | from propertyfrontend.server import app
import os
app.run(host="0.0.0.0", port=int(os.environ['PORT']), debug=True)
| true | true |
1c3de1efb89c939886af9238d6fd6108b6c5dfac | 576 | py | Python | Dynamic Programming/063. Unique Paths II.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 138 | 2020-02-08T05:25:26.000Z | 2021-11-04T11:59:28.000Z | Dynamic Programming/063. Unique Paths II.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | null | null | null | Dynamic Programming/063. Unique Paths II.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 24 | 2021-01-02T07:18:43.000Z | 2022-03-20T08:17:54.000Z | """
63. Unique Paths II
"""
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid):
if len(obstacleGrid) == 0 or obstacleGrid[0][0] == 1:
return 0
n, m = len(obstacleGrid), len(obstacleGrid[0])
if obstacleGrid[n-1][m-1] == 1 : return 0
table = [0]*m
... | 36 | 134 | 0.519097 |
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid):
if len(obstacleGrid) == 0 or obstacleGrid[0][0] == 1:
return 0
n, m = len(obstacleGrid), len(obstacleGrid[0])
if obstacleGrid[n-1][m-1] == 1 : return 0
table = [0]*m
for i, x in enumerate(... | true | true |
1c3de458a4aac0b5d0c70b86684f49d6c6db58f9 | 308 | py | Python | vmraid/patches/v5_0/clear_website_group_and_notifications.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | vmraid/patches/v5_0/clear_website_group_and_notifications.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | vmraid/patches/v5_0/clear_website_group_and_notifications.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import vmraid
def execute():
vmraid.delete_doc("DocType", "Post")
vmraid.delete_doc("DocType", "Website Group")
vmraid.delete_doc("DocType", "Website Route Permission")
vmraid.delete_doc("DocType", "User Vote")
vmraid.delete_doc("DocType", "Notification Count")
| 30.8 | 57 | 0.766234 | from __future__ import unicode_literals
import vmraid
def execute():
vmraid.delete_doc("DocType", "Post")
vmraid.delete_doc("DocType", "Website Group")
vmraid.delete_doc("DocType", "Website Route Permission")
vmraid.delete_doc("DocType", "User Vote")
vmraid.delete_doc("DocType", "Notification Count")
| true | true |
1c3de626512a29b75c62d014fa702750d999e9a6 | 3,395 | py | Python | rigetti_result_analysis.py | filipmazurek/Quantum-Workspace | e2df6cfafa8664cd5fba8786ccf6e0540a0584fd | [
"MIT"
] | null | null | null | rigetti_result_analysis.py | filipmazurek/Quantum-Workspace | e2df6cfafa8664cd5fba8786ccf6e0540a0584fd | [
"MIT"
] | null | null | null | rigetti_result_analysis.py | filipmazurek/Quantum-Workspace | e2df6cfafa8664cd5fba8786ccf6e0540a0584fd | [
"MIT"
] | null | null | null | """
Filip Mazurek - 9/1/2019
Utility to make analyzing results from pyquil easier
"""
from collections import Counter
import numpy as np
import matplotlib.pyplot as plt
def convert_result(measurements):
# TODO: please note the endian-ness and how that affects everything else. Right now least significant bit is ... | 36.505376 | 120 | 0.676878 |
from collections import Counter
import numpy as np
import matplotlib.pyplot as plt
def convert_result(measurements):
num_qubits = len(measurements)
num_trials = len(measurements[0])
results_per_trial = [[-1 for y in range(num_qubits)] for x in range(num_trials)]
for i in range(len(measure... | true | true |
1c3de6a7f2c7ec0bf1595cc539b4d1a6ab81a114 | 7,430 | py | Python | IPython/testing/globalipapp.py | ivanov/ipython | 62cc379d3b454923cb48e94663f385f54ec806cc | [
"BSD-3-Clause-Clear"
] | 2 | 2015-04-21T12:12:43.000Z | 2015-04-21T12:12:54.000Z | IPython/testing/globalipapp.py | ivanov/ipython | 62cc379d3b454923cb48e94663f385f54ec806cc | [
"BSD-3-Clause-Clear"
] | 1 | 2015-07-16T22:26:53.000Z | 2015-07-16T22:26:53.000Z | IPython/testing/globalipapp.py | ivanov/ipython | 62cc379d3b454923cb48e94663f385f54ec806cc | [
"BSD-3-Clause-Clear"
] | null | null | null | """Global IPython app to support test running.
We must start our own ipython object and heavily muck with it so that all the
modifications IPython makes to system behavior don't send the doctest machinery
into a fit. This code should be considered a gross hack, but it gets the job
done.
"""
from __future__ import abs... | 37.908163 | 79 | 0.637954 | from __future__ import absolute_import
from __future__ import print_function
import __builtin__
import os
import sys
from types import MethodType
from . import tools
from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
# test globals. Once we move over to a clean magic ... | true | true |
1c3de74bd608376894fa6007ef978539a4ad6235 | 1,632 | py | Python | apps/zmq-app-template/setup.py | mattreduce/threatbus | 95b1d13e87fbcd1b442458ba13349c4817d5990b | [
"BSD-3-Clause"
] | null | null | null | apps/zmq-app-template/setup.py | mattreduce/threatbus | 95b1d13e87fbcd1b442458ba13349c4817d5990b | [
"BSD-3-Clause"
] | null | null | null | apps/zmq-app-template/setup.py | mattreduce/threatbus | 95b1d13e87fbcd1b442458ba13349c4817d5990b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
author="Tenzir",
author_email="engineering@tenzir.com",
classifiers=[
# https://pypi.org/classifiers/
"Development Status :: 3 - Alpha",
... | 30.222222 | 82 | 0.601103 |
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
author="Tenzir",
author_email="engineering@tenzir.com",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Operating System :... | true | true |
1c3de93ba96df4fa632533d25ab7b90e5bd16d6d | 348 | py | Python | Hackerrank_python/16.XML/97.XML 1 - Find the Score.py | manish1822510059/Hackerrank | 7c6e4553f033f067e04dc6c756ef90cb43f3c4a8 | [
"MIT"
] | 39 | 2020-09-27T05:32:05.000Z | 2022-01-08T18:04:05.000Z | Hackerrank_python/16.XML/97.XML 1 - Find the Score.py | manish1822510059/Hackerrank | 7c6e4553f033f067e04dc6c756ef90cb43f3c4a8 | [
"MIT"
] | 5 | 2020-10-02T13:33:00.000Z | 2021-03-01T14:06:08.000Z | Hackerrank_python/16.XML/97.XML 1 - Find the Score.py | manish1822510059/Hackerrank | 7c6e4553f033f067e04dc6c756ef90cb43f3c4a8 | [
"MIT"
] | 6 | 2020-10-03T04:04:55.000Z | 2021-10-18T04:07:53.000Z | import sys
import xml.etree.ElementTree as etree
def get_attr_number(node):
# your code goes here
return etree.tostring(node).count(b'=')
if __name__ == '__main__':
sys.stdin.readline()
xml = sys.stdin.read()
tree = etree.ElementTree(etree.fromstring(xml))
root = tree.getroot()
p... | 21.75 | 51 | 0.672414 | import sys
import xml.etree.ElementTree as etree
def get_attr_number(node):
return etree.tostring(node).count(b'=')
if __name__ == '__main__':
sys.stdin.readline()
xml = sys.stdin.read()
tree = etree.ElementTree(etree.fromstring(xml))
root = tree.getroot()
print(get_attr_number(... | true | true |
1c3deb66177764b3d0e21e645719a7444b4a50cc | 2,345 | py | Python | files/strategies/cohort-1/level-2/riley_strategy_level_2.py | eurisko-us/eurisko-us.github.io | 74d9d426bc7a965574fbbf76d6528d47b4286fa0 | [
"MIT"
] | null | null | null | files/strategies/cohort-1/level-2/riley_strategy_level_2.py | eurisko-us/eurisko-us.github.io | 74d9d426bc7a965574fbbf76d6528d47b4286fa0 | [
"MIT"
] | null | null | null | files/strategies/cohort-1/level-2/riley_strategy_level_2.py | eurisko-us/eurisko-us.github.io | 74d9d426bc7a965574fbbf76d6528d47b4286fa0 | [
"MIT"
] | 1 | 2020-08-19T17:27:44.000Z | 2020-08-19T17:27:44.000Z |
class RileyStrategyLevel2:
def __init__(self, player_num):
self.player_num = player_num
def decide_ship_movement(self, unit_index, hidden_game_state):
myself = hidden_game_state['players'][self.player_num]
opponent_index = 1 - self.player_num
opponent = hidden_game_state['play... | 36.076923 | 80 | 0.604264 |
class RileyStrategyLevel2:
def __init__(self, player_num):
self.player_num = player_num
def decide_ship_movement(self, unit_index, hidden_game_state):
myself = hidden_game_state['players'][self.player_num]
opponent_index = 1 - self.player_num
opponent = hidden_game_state['play... | true | true |
1c3dec0f609efe04d70c61e6046774ecc554680d | 4,845 | py | Python | pyflocker/ciphers/backends/cryptodome_/asymmetric.py | fossabot/pyflocker | 293df31e32fb796df5c7fba803846c9872e67485 | [
"MIT"
] | null | null | null | pyflocker/ciphers/backends/cryptodome_/asymmetric.py | fossabot/pyflocker | 293df31e32fb796df5c7fba803846c9872e67485 | [
"MIT"
] | null | null | null | pyflocker/ciphers/backends/cryptodome_/asymmetric.py | fossabot/pyflocker | 293df31e32fb796df5c7fba803846c9872e67485 | [
"MIT"
] | null | null | null | from __future__ import annotations
from types import MappingProxyType
from typing import TYPE_CHECKING
from Cryptodome.Cipher import PKCS1_OAEP
from Cryptodome.Signature import DSS, pss
from .. import asymmetric
if TYPE_CHECKING: # pragma: no cover
from ... import base
def get_OAEP(key, padding: base.BaseAsy... | 24.974227 | 79 | 0.615686 | from __future__ import annotations
from types import MappingProxyType
from typing import TYPE_CHECKING
from Cryptodome.Cipher import PKCS1_OAEP
from Cryptodome.Signature import DSS, pss
from .. import asymmetric
if TYPE_CHECKING:
from ... import base
def get_OAEP(key, padding: base.BaseAsymmetricPadding):
... | true | true |
1c3dee6f69920e802052e38cde5bafb4a5698576 | 575 | py | Python | app/cadastros/helpers.py | Leodma/sisAre | 2d41528bdb457b5e6ca77d29df4d67b0a661d179 | [
"bzip2-1.0.6"
] | null | null | null | app/cadastros/helpers.py | Leodma/sisAre | 2d41528bdb457b5e6ca77d29df4d67b0a661d179 | [
"bzip2-1.0.6"
] | null | null | null | app/cadastros/helpers.py | Leodma/sisAre | 2d41528bdb457b5e6ca77d29df4d67b0a661d179 | [
"bzip2-1.0.6"
] | null | null | null | def tira_paragrafo(texto):
return texto.replace('\r\n',';')
def cria_lista(texto):
return texto.strip().replace('\r\n',';').split(';')
def lista_para_texto(lista):
texto = ';'.join(lista)
return texto
def cria_lista_db(texto):
return texto.strip().split(';')
def cria_texto_formulario(texto)... | 20.535714 | 55 | 0.615652 | def tira_paragrafo(texto):
return texto.replace('\r\n',';')
def cria_lista(texto):
return texto.strip().replace('\r\n',';').split(';')
def lista_para_texto(lista):
texto = ';'.join(lista)
return texto
def cria_lista_db(texto):
return texto.strip().split(';')
def cria_texto_formulario(texto)... | true | true |
1c3dee89e4e7a075047b3b7211c4bba5e5b0daf7 | 1,176 | py | Python | var/spack/repos/builtin/packages/flit/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/flit/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/flit/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Flit(MakefilePackage):
"""Floating-point Litmus Tests (FLiT) is a C++ test infrastructure... | 33.6 | 95 | 0.669218 |
from spack import *
class Flit(MakefilePackage):
homepage = "https://pruners.github.io/flit"
url = "https://github.com/PRUNERS/FLiT/archive/v2.1.0.tar.gz"
git = "https://github.com/PRUNERS/FLiT.git"
tags = ['e4s']
version('develop', branch='devel')
version('2.1.0', sha256='b... | true | true |
1c3deec1aa2d40b6d2cb3e0da544725b1e510827 | 2,221 | py | Python | prepare/prepare_3D_RS_dense_NN_rgb_3.py | KelvinTao/pointSIFT_Age2 | b0684ee989b5f6f3dca25e9bbf15b3c5fd8cf1cf | [
"Apache-2.0"
] | null | null | null | prepare/prepare_3D_RS_dense_NN_rgb_3.py | KelvinTao/pointSIFT_Age2 | b0684ee989b5f6f3dca25e9bbf15b3c5fd8cf1cf | [
"Apache-2.0"
] | null | null | null | prepare/prepare_3D_RS_dense_NN_rgb_3.py | KelvinTao/pointSIFT_Age2 | b0684ee989b5f6f3dca25e9bbf15b3c5fd8cf1cf | [
"Apache-2.0"
] | null | null | null | import numpy as np
import glob
# train data
## collect points
def mkdata(NUM_CLASS,ids,ageNN):
#ids=np.loadtxt(filePath,dtype=str,skiprows=1,delimiter=',',usecols=0)
points_set=[]
rgb_set=[]
for i,idi in enumerate(ids):
points_set.append(np.loadtxt(path+'/points/21000_xyzrgb/'+idi+'.xyz.txt',de... | 34.169231 | 139 | 0.703737 | import numpy as np
import glob
CLASS,ids,ageNN):
points_set=[]
rgb_set=[]
for i,idi in enumerate(ids):
points_set.append(np.loadtxt(path+'/points/21000_xyzrgb/'+idi+'.xyz.txt',delimiter=' '))
rgb_set.append(np.loadtxt(path+'/points/21000_xyzrgb/'+idi+'.rgb.txt',delimiter=' '))
... | true | true |
1c3def7775f8b3c684aa23d9769b246c21a929d0 | 3,263 | py | Python | plugins/npr/start_tracking.py | thecarebot/carebot | 7219ea27e8ae5a0300c73d61022174f5907404b5 | [
"MIT"
] | 50 | 2016-02-02T20:34:56.000Z | 2020-01-23T18:26:13.000Z | plugins/npr/start_tracking.py | thecarebot/carebot | 7219ea27e8ae5a0300c73d61022174f5907404b5 | [
"MIT"
] | 287 | 2016-01-29T20:43:04.000Z | 2017-07-12T19:09:40.000Z | plugins/npr/start_tracking.py | thecarebot/carebot | 7219ea27e8ae5a0300c73d61022174f5907404b5 | [
"MIT"
] | 10 | 2016-03-28T19:56:38.000Z | 2022-03-11T22:31:36.000Z | import logging
import re
from scrapers.npr_api import NPRAPIScraper
from util.analytics import GoogleAnalytics
from util.models import Story
from util.slack import SlackTools
from plugins.base import CarebotPlugin
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
npr_api_scrape... | 36.662921 | 251 | 0.525283 | import logging
import re
from scrapers.npr_api import NPRAPIScraper
from util.analytics import GoogleAnalytics
from util.models import Story
from util.slack import SlackTools
from plugins.base import CarebotPlugin
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
npr_api_scrape... | false | true |
1c3defd2101b508f1a5eb460f42e097d74389927 | 1,217 | py | Python | invites/forms.py | phildini/bockus | 004508166f5b1a7c3c4d8accf32578a80379b385 | [
"MIT"
] | 3 | 2015-07-15T05:29:17.000Z | 2021-06-23T21:50:25.000Z | invites/forms.py | phildini/bockus | 004508166f5b1a7c3c4d8accf32578a80379b385 | [
"MIT"
] | 4 | 2020-02-11T22:15:04.000Z | 2021-06-10T17:41:51.000Z | invites/forms.py | phildini/bockus | 004508166f5b1a7c3c4d8accf32578a80379b385 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
from .models import Invitation
class InvitationForm(forms.ModelForm):
class Meta:
model = Invitation
fields = ['email']
def clean(self):
try:
existing_u... | 26.456522 | 74 | 0.644207 | from django import forms
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
from .models import Invitation
class InvitationForm(forms.ModelForm):
class Meta:
model = Invitation
fields = ['email']
def clean(self):
try:
existing_u... | true | true |
1c3df03a42ca51c25dbdef75ed38729db3871c67 | 1,630 | py | Python | tests/test_sklearn_label_encoder_converter.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 2,772 | 2020-05-04T21:03:40.000Z | 2022-03-30T11:00:03.000Z | tests/test_sklearn_label_encoder_converter.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 486 | 2020-05-05T00:45:44.000Z | 2022-03-15T01:02:31.000Z | tests/test_sklearn_label_encoder_converter.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 232 | 2019-11-02T22:06:38.000Z | 2022-03-25T07:36:17.000Z | """
Tests sklearn LabelEncoder converter
"""
import unittest
import numpy as np
import torch
from sklearn.preprocessing import LabelEncoder
import hummingbird.ml
from onnxconverter_common.data_types import Int32TensorType
class TestSklearnLabelEncoderConverter(unittest.TestCase):
def test_model_label_encoder(sel... | 28.103448 | 110 | 0.639264 | import unittest
import numpy as np
import torch
from sklearn.preprocessing import LabelEncoder
import hummingbird.ml
from onnxconverter_common.data_types import Int32TensorType
class TestSklearnLabelEncoderConverter(unittest.TestCase):
def test_model_label_encoder(self):
model = LabelEncoder()
da... | true | true |
1c3df251962b43184bf8b5caa1dd0219ced3dfc3 | 86 | py | Python | VOPP_web/VOPP_web/setup.py | kingeta/VOPP | 2d1b80cf9be9f035cb9bda7f0b8f82fbda9bf226 | [
"MIT"
] | 4 | 2020-10-24T18:37:06.000Z | 2020-10-25T19:48:17.000Z | VOPP_web/VOPP_web/setup.py | kingeta/VOPP | 2d1b80cf9be9f035cb9bda7f0b8f82fbda9bf226 | [
"MIT"
] | null | null | null | VOPP_web/VOPP_web/setup.py | kingeta/VOPP | 2d1b80cf9be9f035cb9bda7f0b8f82fbda9bf226 | [
"MIT"
] | null | null | null | #import subprocess
#import pymongo
#client = pymongo.MongoClient()
#db = client.notes | 17.2 | 31 | 0.767442 | true | true | |
1c3df49e4607ba924b05a533daf763f35573c581 | 9,506 | py | Python | src/bin/sintact.py | ohmono/analizador-lexico | 7179a123987ad497c008dfc295482759eb238e5f | [
"MIT"
] | null | null | null | src/bin/sintact.py | ohmono/analizador-lexico | 7179a123987ad497c008dfc295482759eb238e5f | [
"MIT"
] | null | null | null | src/bin/sintact.py | ohmono/analizador-lexico | 7179a123987ad497c008dfc295482759eb238e5f | [
"MIT"
] | null | null | null |
class grammar():
terminals = {
"ELSE": "ELSE",
"IF": "IF",
"BOOL": "T",
"INT": "T",
"FLOAT": "T",
"STRING": "T",
"IDENTIFY": "V",
"CHARCONST": "V",
"FLOATCONST": "D",
"INTCONST": "D",
"PLUS": "O",
"MINUS": "O",
... | 40.623932 | 95 | 0.411004 |
class grammar():
terminals = {
"ELSE": "ELSE",
"IF": "IF",
"BOOL": "T",
"INT": "T",
"FLOAT": "T",
"STRING": "T",
"IDENTIFY": "V",
"CHARCONST": "V",
"FLOATCONST": "D",
"INTCONST": "D",
"PLUS": "O",
"MINUS": "O",
... | true | true |
1c3df651ee2881b7471116529c801f4e1e132326 | 1,304 | py | Python | tests/test_graph.py | SkamDart/codegrapher | b5191efcfadb933e846ae1d9e3136c07c4da6a8f | [
"MIT"
] | 11 | 2015-01-07T02:54:31.000Z | 2019-04-16T21:43:02.000Z | tests/test_graph.py | SkamDart/codegrapher | b5191efcfadb933e846ae1d9e3136c07c4da6a8f | [
"MIT"
] | 2 | 2019-02-08T20:28:35.000Z | 2020-12-15T05:29:16.000Z | tests/test_graph.py | SkamDart/codegrapher | b5191efcfadb933e846ae1d9e3136c07c4da6a8f | [
"MIT"
] | 4 | 2015-01-06T07:39:05.000Z | 2019-02-08T20:25:49.000Z | import os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(self):
string1 = 'this'
string2 = dc(string1)
s... | 26.08 | 92 | 0.633436 | import os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(self):
string1 = 'this'
string2 = dc(string1)
s... | true | true |
1c3df7222086a65563b75ff7f70519dd7c3720fe | 360 | py | Python | setup.py | shlnz/poe_tempest_iteminfo | 60acc4beec3e1856e738ccf2d26c918e91c863cc | [
"MIT"
] | null | null | null | setup.py | shlnz/poe_tempest_iteminfo | 60acc4beec3e1856e738ccf2d26c918e91c863cc | [
"MIT"
] | 1 | 2015-08-07T16:23:38.000Z | 2015-08-07T16:23:38.000Z | setup.py | shlnz/poe_tempest_iteminfo | 60acc4beec3e1856e738ccf2d26c918e91c863cc | [
"MIT"
] | null | null | null | from distutils.core import setup
import py2exe
setup(
name="POE Tempests",
author="Jens Thom",
version="0.2.1",
options={'py2exe': {'bundle_files': 1, 'compressed': True}},
zipfile=None,
console=[{"script": "poe_tempest.py",
"icon_resources": [(1, "icon.ico")],
"dest... | 25.714286 | 64 | 0.563889 | from distutils.core import setup
import py2exe
setup(
name="POE Tempests",
author="Jens Thom",
version="0.2.1",
options={'py2exe': {'bundle_files': 1, 'compressed': True}},
zipfile=None,
console=[{"script": "poe_tempest.py",
"icon_resources": [(1, "icon.ico")],
"dest... | true | true |
1c3df7279b852b01379907504322246f58ff2262 | 769 | py | Python | test/sanity/issue6251-node-crypto/test.py | astrocean/nw.js | 23e2fd1ac08a5b4c2adcd26dd2a2aeb082701911 | [
"MIT"
] | 2 | 2021-02-23T12:02:10.000Z | 2021-07-05T01:28:55.000Z | test/sanity/issue6251-node-crypto/test.py | Huynhanh883/nw.js | fe0b0d92837f8cf570f7ef5a9425e396585ce0a0 | [
"MIT"
] | null | null | null | test/sanity/issue6251-node-crypto/test.py | Huynhanh883/nw.js | fe0b0d92837f8cf570f7ef5a9425e396585ce0a0 | [
"MIT"
] | 1 | 2020-12-01T19:52:49.000Z | 2020-12-01T19:52:49.000Z | import time
import os
import shutil
import subprocess
import platform
import sys
from subprocess import Popen, PIPE
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = O... | 27.464286 | 100 | 0.777633 | import time
import os
import shutil
import subprocess
import platform
import sys
from subprocess import Popen, PIPE
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = O... | false | true |
1c3df7d38b0ca5eef734240429ccf4f6a7a6e064 | 11,117 | py | Python | experiments/train_IRCR_spread.py | baicenxiao/Shaping-Advice | a5de626792dc691f301ae6c5c4384931318c0aba | [
"MIT"
] | null | null | null | experiments/train_IRCR_spread.py | baicenxiao/Shaping-Advice | a5de626792dc691f301ae6c5c4384931318c0aba | [
"MIT"
] | null | null | null | experiments/train_IRCR_spread.py | baicenxiao/Shaping-Advice | a5de626792dc691f301ae6c5c4384931318c0aba | [
"MIT"
] | null | null | null | import argparse
import numpy as np
import tensorflow as tf
import time
import pickle
import os
import maddpg.common.tf_util as U
from maddpg.trainer.maddpg import MADDPGAgentTrainer
import tensorflow.contrib.layers as layers
def parse_args():
parser = argparse.ArgumentParser("Reinforcement Learning experiments fo... | 49.190265 | 157 | 0.602321 | import argparse
import numpy as np
import tensorflow as tf
import time
import pickle
import os
import maddpg.common.tf_util as U
from maddpg.trainer.maddpg import MADDPGAgentTrainer
import tensorflow.contrib.layers as layers
def parse_args():
parser = argparse.ArgumentParser("Reinforcement Learning experiments fo... | true | true |
1c3df8f0bc4a6c6784aa88020c984a8f205a872b | 3,632 | py | Python | app/scripts/management/commands/notify_pairwise.py | Sirius-social/TMTM | 5b4d426e358fc9fd6cff7ec84861c0388d3785ce | [
"Apache-2.0"
] | null | null | null | app/scripts/management/commands/notify_pairwise.py | Sirius-social/TMTM | 5b4d426e358fc9fd6cff7ec84861c0388d3785ce | [
"Apache-2.0"
] | null | null | null | app/scripts/management/commands/notify_pairwise.py | Sirius-social/TMTM | 5b4d426e358fc9fd6cff7ec84861c0388d3785ce | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
from typing import List
import sirius_sdk
from sirius_sdk.agent.wallet import NYMRole
from django.conf import settings
from channels.db import database_sync_to_async
from django.core.management.base import BaseCommand
from ui.models import PairwiseRecord
from wrapper.models import Ledger... | 37.061224 | 115 | 0.591685 | import asyncio
import logging
from typing import List
import sirius_sdk
from sirius_sdk.agent.wallet import NYMRole
from django.conf import settings
from channels.db import database_sync_to_async
from django.core.management.base import BaseCommand
from ui.models import PairwiseRecord
from wrapper.models import Ledger... | true | true |
1c3df9651bbbf8ab9a666c63c99033113a2e4ee7 | 14,917 | py | Python | deepxde/model.py | ziyi-yang/deepxde | 61af63c3eeb6ea625670b2886be1bf51fa1df554 | [
"Apache-2.0"
] | null | null | null | deepxde/model.py | ziyi-yang/deepxde | 61af63c3eeb6ea625670b2886be1bf51fa1df554 | [
"Apache-2.0"
] | null | null | null | deepxde/model.py | ziyi-yang/deepxde | 61af63c3eeb6ea625670b2886be1bf51fa1df554 | [
"Apache-2.0"
] | 1 | 2021-04-06T07:16:23.000Z | 2021-04-06T07:16:23.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from . import display
from . import losses as losses_module
from . import metrics as metrics_module
from . import train as train_module
from .backend import tf
from .callbacks import Callbac... | 36.923267 | 165 | 0.609104 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from . import display
from . import losses as losses_module
from . import metrics as metrics_module
from . import train as train_module
from .backend import tf
from .callbacks import Callbac... | true | true |
1c3df9e5cb7a2ba8fc0b5c99848d68ddb59a0111 | 3,095 | py | Python | pypureclient/flasharray/FA_2_5/models/alert_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_5/models/alert_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_5/models/alert_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 27.633929 | 105 | 0.53958 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_5 import models
class AlertResponse(object):
swagger_types = {
'items': 'list[Alert]'
}
attribute_map = {
'items': 'items'
}
re... | true | true |
1c3dfc60d521dd6aa652983f8187c2ac98919135 | 4,860 | py | Python | allennlp/data/dataset_readers/coreference_resolution/preco.py | apmoore1/allennlp | bdb29a831ed68cb948b18b42fa61646b9ec11bf8 | [
"Apache-2.0"
] | null | null | null | allennlp/data/dataset_readers/coreference_resolution/preco.py | apmoore1/allennlp | bdb29a831ed68cb948b18b42fa61646b9ec11bf8 | [
"Apache-2.0"
] | null | null | null | allennlp/data/dataset_readers/coreference_resolution/preco.py | apmoore1/allennlp | bdb29a831ed68cb948b18b42fa61646b9ec11bf8 | [
"Apache-2.0"
] | 1 | 2020-02-19T11:34:32.000Z | 2020-02-19T11:34:32.000Z | import json
import logging
from typing import Dict, List, Optional, Tuple
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.coreference_resolution.util import make_coref_instance
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
... | 45 | 106 | 0.69177 | import json
import logging
from typing import Dict, List, Optional, Tuple
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.coreference_resolution.util import make_coref_instance
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
... | true | true |
1c3dfc8ade0f758b624c2912f8e557641f3525bb | 883 | py | Python | schemas/users.py | iliadmitriev/auth-fapi | a219efd5a8daa9d5f876355cde6b974021ca7890 | [
"MIT"
] | null | null | null | schemas/users.py | iliadmitriev/auth-fapi | a219efd5a8daa9d5f876355cde6b974021ca7890 | [
"MIT"
] | 131 | 2021-09-29T06:07:18.000Z | 2022-03-31T08:29:30.000Z | schemas/users.py | iliadmitriev/auth-fapi | a219efd5a8daa9d5f876355cde6b974021ca7890 | [
"MIT"
] | null | null | null | from typing import Optional
from datetime import datetime
from pydantic import BaseModel, EmailStr
# base shared properties
class UserBase(BaseModel):
email: Optional[EmailStr] = None
is_active: Optional[bool] = True
is_superuser: bool = False
confirmed: bool = False
# user create query
class UserC... | 19.195652 | 41 | 0.698754 | from typing import Optional
from datetime import datetime
from pydantic import BaseModel, EmailStr
class UserBase(BaseModel):
email: Optional[EmailStr] = None
is_active: Optional[bool] = True
is_superuser: bool = False
confirmed: bool = False
class UserCreate(UserBase):
email: EmailStr
pa... | true | true |
1c3dfcce6e7c7c8b0e519b4019603b5e00de96af | 77 | py | Python | problemtools/_version.py | mzuenni/problemtools | 6e147959f237c3637f77103c2fa642096f862ae4 | [
"MIT"
] | 84 | 2015-03-25T19:13:38.000Z | 2022-03-20T18:19:01.000Z | problemtools/_version.py | mzuenni/problemtools | 6e147959f237c3637f77103c2fa642096f862ae4 | [
"MIT"
] | 151 | 2015-03-29T18:28:28.000Z | 2021-12-10T21:35:04.000Z | problemtools/_version.py | mzuenni/problemtools | 6e147959f237c3637f77103c2fa642096f862ae4 | [
"MIT"
] | 60 | 2015-01-20T21:50:46.000Z | 2022-03-27T10:00:07.000Z | # Auto-generated from git changelog, do not edit!
__version__ = '1.20210928'
| 25.666667 | 49 | 0.753247 |
__version__ = '1.20210928'
| true | true |
1c3dfd5ff463099a6195658c5168eb89b1302e89 | 387 | py | Python | horas/wsgi.py | fabianabarca/horas | 526c065803f1487a39644eb54f65b7b4f3a036ee | [
"MIT"
] | null | null | null | horas/wsgi.py | fabianabarca/horas | 526c065803f1487a39644eb54f65b7b4f3a036ee | [
"MIT"
] | 2 | 2022-03-14T17:29:15.000Z | 2022-03-14T17:46:17.000Z | horas/wsgi.py | fabianabarca/horas | 526c065803f1487a39644eb54f65b7b4f3a036ee | [
"MIT"
] | null | null | null | """
WSGI config for horas project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'horas.settings')
application = get_wsgi_application()
| true | true |
1c3dffbc46c058f6a60aeb5cb2b10a350cef6bc9 | 3,627 | py | Python | homeassistant/generated/config_flows.py | chboland/homassistant-core | 1df6eb124789213f7175a513729c4272e46736bd | [
"Apache-2.0"
] | null | null | null | homeassistant/generated/config_flows.py | chboland/homassistant-core | 1df6eb124789213f7175a513729c4272e46736bd | [
"Apache-2.0"
] | 1 | 2022-03-17T15:09:09.000Z | 2022-03-17T15:09:09.000Z | homeassistant/generated/config_flows.py | chboland/homassistant-core | 1df6eb124789213f7175a513729c4272e46736bd | [
"Apache-2.0"
] | null | null | null | """Automatically generated by hassfest.
To update, run python3 -m script.hassfest
"""
# fmt: off
FLOWS = [
"abode",
"accuweather",
"acmeda",
"adguard",
"advantage_air",
"agent_dvr",
"airly",
"airvisual",
"alarmdecoder",
"almond",
"ambiclimate",
"ambient_station",
"... | 15.566524 | 41 | 0.498484 |
FLOWS = [
"abode",
"accuweather",
"acmeda",
"adguard",
"advantage_air",
"agent_dvr",
"airly",
"airvisual",
"alarmdecoder",
"almond",
"ambiclimate",
"ambient_station",
"arcam_fmj",
"atag",
"august",
"avri",
"awair",
"axis",
"azure_devops",
... | true | true |
1c3e000d20f4633684abe2743e374d7c75e798ce | 1,668 | py | Python | lib/naf.py | KelvinKan/CP-Flow | d01303cb4ebeb5a0bbfca638ffaf5b7a8ec22fb1 | [
"MIT"
] | 64 | 2021-02-22T21:24:39.000Z | 2022-03-25T20:30:39.000Z | lib/naf.py | KelvinKan/CP-Flow | d01303cb4ebeb5a0bbfca638ffaf5b7a8ec22fb1 | [
"MIT"
] | null | null | null | lib/naf.py | KelvinKan/CP-Flow | d01303cb4ebeb5a0bbfca638ffaf5b7a8ec22fb1 | [
"MIT"
] | 9 | 2021-02-24T15:12:40.000Z | 2022-03-05T06:14:17.000Z | # noinspection PyPep8Naming
from torch.nn import functional as F
from lib.functional import *
def sigmoid_flow(x, logdet=0, ndim=4, params=None, delta=DELTA, logit_end=True):
"""
element-wise sigmoidal flow described in `Neural Autoregressive Flows` (https://arxiv.org/pdf/1804.00779.pdf)
:param x: input
... | 39.714286 | 113 | 0.660671 |
from torch.nn import functional as F
from lib.functional import *
def sigmoid_flow(x, logdet=0, ndim=4, params=None, delta=DELTA, logit_end=True):
assert params is not None, 'parameters not provided'
assert params.size(2) == ndim*3, 'params shape[2] does not match ndim * 3'
a = act_a(params[:, :, 0 * nd... | true | true |
1c3e0022c9597e37f4aceb94b28551f921fce1b4 | 2,048 | py | Python | feather/constants.py | oluwaseunladeinde/yellowfeather | 134783fdd90d6f4118eae1d1dad029a245773106 | [
"MIT"
] | null | null | null | feather/constants.py | oluwaseunladeinde/yellowfeather | 134783fdd90d6f4118eae1d1dad029a245773106 | [
"MIT"
] | null | null | null | feather/constants.py | oluwaseunladeinde/yellowfeather | 134783fdd90d6f4118eae1d1dad029a245773106 | [
"MIT"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
TYPES = (
('house', _('Houses')),
('villa', _('Villas')),
('penthouse', _('Penthouses')),
('apartment', _('Apartments')),
('residencial-land', _('Residential Land')),
('corporate-office', _('Corporate Offices')),
('commercial-office', ... | 31.030303 | 120 | 0.514648 | from django.utils.translation import ugettext_lazy as _
TYPES = (
('house', _('Houses')),
('villa', _('Villas')),
('penthouse', _('Penthouses')),
('apartment', _('Apartments')),
('residencial-land', _('Residential Land')),
('corporate-office', _('Corporate Offices')),
('commercial-office', ... | true | true |
1c3e00789415d4f86dc0f0402e28330ecb03abe5 | 677 | py | Python | Tree/SumofLeftLeaves.py | PK-100/Competitive_Programming | d0863feaaa99462b2999e85dcf115f7a6c08bb8d | [
"MIT"
] | 70 | 2018-06-25T21:20:15.000Z | 2022-03-24T03:55:17.000Z | Tree/Sum-of-Left-Leaves.py | An3sha/Competitive_Programming | ee7eadf51939a360d0b004d787ebabda583e92f0 | [
"MIT"
] | 4 | 2018-09-04T13:12:20.000Z | 2021-06-20T08:29:12.000Z | Tree/Sum-of-Left-Leaves.py | An3sha/Competitive_Programming | ee7eadf51939a360d0b004d787ebabda583e92f0 | [
"MIT"
] | 24 | 2018-12-26T05:15:32.000Z | 2022-01-23T23:04:54.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def sumOfLeftLeaves(self, root: TreeNode) -> int:
result = 0
if root:
if root.le... | 39.823529 | 111 | 0.602659 |
class Solution:
def sumOfLeftLeaves(self, root: TreeNode) -> int:
result = 0
if root:
if root.left and not root.left.left and not root.left.right:
result += root.left.val
else:
result += self.sumOfLeftLeaves(root.left)
resul... | true | true |
1c3e011942f345472ff9a4ff308d85d8c4906208 | 13,815 | py | Python | epistasis/pyplot/coefs.py | harmsm/epistasis | 741b25b3e28015aeeba8d4efc94af1e1d811cd63 | [
"Unlicense"
] | null | null | null | epistasis/pyplot/coefs.py | harmsm/epistasis | 741b25b3e28015aeeba8d4efc94af1e1d811cd63 | [
"Unlicense"
] | null | null | null | epistasis/pyplot/coefs.py | harmsm/epistasis | 741b25b3e28015aeeba8d4efc94af1e1d811cd63 | [
"Unlicense"
] | 2 | 2020-04-02T00:58:24.000Z | 2021-11-16T13:30:30.000Z | __description__ = \
"""
Plot barplot with epistatic coefficients.
"""
__author__ = "Zach Sailer"
import gpmap
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
import matplotlib as mpl
import numpy as np
from scipy.stats import norm as scipy_norm
class Bunch:
... | 31.541096 | 79 | 0.552081 | __description__ = \
"""
Plot barplot with epistatic coefficients.
"""
__author__ = "Zach Sailer"
import gpmap
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
import matplotlib as mpl
import numpy as np
from scipy.stats import norm as scipy_norm
class Bunch:
... | true | true |
1c3e02269e6e2d82f9b5467c72c8bd2643a182c4 | 3,781 | py | Python | pex/tools/commands/digraph.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | pex/tools/commands/digraph.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | pex/tools/commands/digraph.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
from pex.typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import IO, Dict, List, Mapping, Optional, Tuple
Value = Optional[str]
... | 32.316239 | 99 | 0.56493 |
from __future__ import absolute_import
from pex.typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import IO, Dict, List, Mapping, Optional, Tuple
Value = Optional[str]
Attributes = Mapping[str, Value]
class DiGraph(object):
@staticmethod
def _render_ID(value):
... | true | true |
1c3e0255111886053eae804e26db41e82e52d72c | 1,047 | py | Python | .github/workflows/dev/codemeta2citation.py | jurysek/lstmcpipe-1 | 978143b60ef7d9851d91626666ca65113764c4d9 | [
"MIT"
] | null | null | null | .github/workflows/dev/codemeta2citation.py | jurysek/lstmcpipe-1 | 978143b60ef7d9851d91626666ca65113764c4d9 | [
"MIT"
] | null | null | null | .github/workflows/dev/codemeta2citation.py | jurysek/lstmcpipe-1 | 978143b60ef7d9851d91626666ca65113764c4d9 | [
"MIT"
] | null | null | null | from pathlib import Path
from ruamel.yaml import YAML
import json
def codemeta2citation(codemeta_path='codemeta.json', citation_path='CITATION.cff'):
codemeta = json.load(open(codemeta_path))
citation = {'title': codemeta['name'],
'type': 'software',
'authors': [],
... | 33.774194 | 127 | 0.601719 | from pathlib import Path
from ruamel.yaml import YAML
import json
def codemeta2citation(codemeta_path='codemeta.json', citation_path='CITATION.cff'):
codemeta = json.load(open(codemeta_path))
citation = {'title': codemeta['name'],
'type': 'software',
'authors': [],
... | true | true |
1c3e0257c6ac580b52b8817dfc6134af8071cfa3 | 5,287 | py | Python | pulsar-client-cpp/python/pulsar/schema/definition.py | ganeshs/pulsar | 4f43bdad798a74970489be450338078bc4684d72 | [
"Apache-2.0"
] | null | null | null | pulsar-client-cpp/python/pulsar/schema/definition.py | ganeshs/pulsar | 4f43bdad798a74970489be450338078bc4684d72 | [
"Apache-2.0"
] | null | null | null | pulsar-client-cpp/python/pulsar/schema/definition.py | ganeshs/pulsar | 4f43bdad798a74970489be450338078bc4684d72 | [
"Apache-2.0"
] | null | null | null | #
# 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... | 25.541063 | 90 | 0.603367 |
from abc import abstractmethod, ABCMeta
from enum import Enum, EnumMeta
from collections import OrderedDict
from six import with_metaclass
def _check_record_or_field(x):
if (type(x) is type and not issubclass(x, Record)) \
and not isinstance(x, Field):
raise Exception('Argum... | true | true |
1c3e02814e38959fa7456f32b8249967ebd21bab | 127 | py | Python | src/battery.py | MITEVT/soc-modeling | 8827c6b7c019ded63f1c12dfd4e599f95af11441 | [
"MIT"
] | 1 | 2019-02-04T14:32:18.000Z | 2019-02-04T14:32:18.000Z | src/battery.py | MITEVT/soc-modeling | 8827c6b7c019ded63f1c12dfd4e599f95af11441 | [
"MIT"
] | null | null | null | src/battery.py | MITEVT/soc-modeling | 8827c6b7c019ded63f1c12dfd4e599f95af11441 | [
"MIT"
] | null | null | null | class Battery(object):
def __init__(self, capacity_ah):
self.capacity_ah = capacity_ah
self.available_ah = capacity_ah
| 15.875 | 33 | 0.76378 | class Battery(object):
def __init__(self, capacity_ah):
self.capacity_ah = capacity_ah
self.available_ah = capacity_ah
| true | true |
1c3e02a05a300cac523962bae33502cc594c7744 | 238 | py | Python | mmdet/models/backbones/__init__.py | greathope/NDL-image-detection-3rd-solution | 0cb13e38be0a00d7ab4ceed60dac40d60a56a4dd | [
"MIT"
] | 2 | 2020-03-21T06:47:32.000Z | 2021-11-12T07:50:21.000Z | mmdet/models/backbones/__init__.py | greathope/NDL-image-detection-3rd-solution | 0cb13e38be0a00d7ab4ceed60dac40d60a56a4dd | [
"MIT"
] | 4 | 2021-03-19T11:32:25.000Z | 2022-03-12T00:19:27.000Z | mmdet/models/backbones/__init__.py | greathope/NDL-image-detection-3rd-solution | 0cb13e38be0a00d7ab4ceed60dac40d60a56a4dd | [
"MIT"
] | 1 | 2020-03-25T02:29:36.000Z | 2020-03-25T02:29:36.000Z | from .hrnet import HRNet
from .resnet import ResNet, make_res_layer
from .resnext import ResNeXt
from .ssd_vgg import SSDVGG
from .seresnet import SeResNet
__all__ = ['ResNet', 'make_res_layer', 'ResNeXt', 'SSDVGG', 'HRNet', 'SeResNet']
| 29.75 | 80 | 0.764706 | from .hrnet import HRNet
from .resnet import ResNet, make_res_layer
from .resnext import ResNeXt
from .ssd_vgg import SSDVGG
from .seresnet import SeResNet
__all__ = ['ResNet', 'make_res_layer', 'ResNeXt', 'SSDVGG', 'HRNet', 'SeResNet']
| true | true |
1c3e02bccffcb2afb3f53a11942cc753b7afffb8 | 2,638 | py | Python | tools/sosreport/tower.py | mhurron/awx | 97a7eeb3c86ec4bc4b6303533207150cb1dbac9d | [
"Apache-2.0"
] | 1 | 2019-01-30T20:38:53.000Z | 2019-01-30T20:38:53.000Z | tools/sosreport/tower.py | mhurron/awx | 97a7eeb3c86ec4bc4b6303533207150cb1dbac9d | [
"Apache-2.0"
] | 2 | 2020-06-18T15:00:24.000Z | 2022-03-02T04:00:36.000Z | tools/sosreport/tower.py | mhurron/awx | 97a7eeb3c86ec4bc4b6303533207150cb1dbac9d | [
"Apache-2.0"
] | 5 | 2020-12-14T20:43:58.000Z | 2022-03-24T16:30:54.000Z | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import sos
from distutils.version import LooseVersion
SOSREPORT_TOWER_COMMANDS = [
"ansible --version", # ansible core version
"awx-manage --version", # tower version
"awx-manage list_instances", # tower cluster configuration
"awx-manage r... | 30.321839 | 105 | 0.636846 |
import sos
from distutils.version import LooseVersion
SOSREPORT_TOWER_COMMANDS = [
"ansible --version",
"awx-manage --version",
"awx-manage list_instances",
"awx-manage run_dispatcher --status",
"supervisorctl status",
"rabbitmqctl status",
"rabbitmqctl cluster_status",
"... | true | true |
1c3e04c42e464fd07858dbd7a510a64ff6926daf | 280 | py | Python | src/django_dag_admin/formset.py | bva-icx/django-dag-admin | ab8e2df2ae93b3afff81e0cb70bd87f9d60644ee | [
"Apache-2.0"
] | null | null | null | src/django_dag_admin/formset.py | bva-icx/django-dag-admin | ab8e2df2ae93b3afff81e0cb70bd87f9d60644ee | [
"Apache-2.0"
] | null | null | null | src/django_dag_admin/formset.py | bva-icx/django-dag-admin | ab8e2df2ae93b3afff81e0cb70bd87f9d60644ee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.forms.models import BaseInlineFormSet
class DjangoDagAdminFormSet(BaseInlineFormSet):
def get_form_kwargs(self, index):
kwargs = super().get_form_kwargs(index)
kwargs['parent_object'] = self.instance
return kwargs
| 28 | 49 | 0.707143 |
from django.forms.models import BaseInlineFormSet
class DjangoDagAdminFormSet(BaseInlineFormSet):
def get_form_kwargs(self, index):
kwargs = super().get_form_kwargs(index)
kwargs['parent_object'] = self.instance
return kwargs
| true | true |
1c3e05d2179e991c8fd1730a01795aa8e342575a | 2,283 | py | Python | cdips/lcproc/period_find_for_cluster.py | lgbouma/cdips | 187e15e620cd44160372dbfa9da989d38722c3e5 | [
"MIT"
] | 1 | 2019-10-04T02:03:25.000Z | 2019-10-04T02:03:25.000Z | cdips/lcproc/period_find_for_cluster.py | lgbouma/cdips | 187e15e620cd44160372dbfa9da989d38722c3e5 | [
"MIT"
] | 3 | 2019-08-17T20:33:23.000Z | 2021-08-18T17:55:10.000Z | cdips/lcproc/period_find_for_cluster.py | lgbouma/cdips | 187e15e620cd44160372dbfa9da989d38722c3e5 | [
"MIT"
] | null | null | null | """
after get_lightcurves_for_cluster_stars, you can run some period-finding
routines
"""
import numpy as np, pandas as pd
from astropy.io import fits
from glob import glob
import os
from astrobase import periodbase, checkplot
def do_period_finding_fitslc(lcpath, fluxap='TFA2', period_min=0.5, outdir=None):
if n... | 33.086957 | 81 | 0.549277 | import numpy as np, pandas as pd
from astropy.io import fits
from glob import glob
import os
from astrobase import periodbase, checkplot
def do_period_finding_fitslc(lcpath, fluxap='TFA2', period_min=0.5, outdir=None):
if not outdir:
outdir = os.path.dirname(lcpath)
outfile = os.path.basename(lcpath)... | true | true |
1c3e06d700fd8d978fa4cb832a94077e2ac73f9e | 184 | py | Python | fog/cli/reporting/__init__.py | Yomguithereal/fog | 0b2defd7c413b55766c4368e17e1238dfc3c8b81 | [
"MIT"
] | 17 | 2018-04-26T15:37:45.000Z | 2021-05-18T05:58:10.000Z | fog/cli/reporting/__init__.py | Yomguithereal/fog | 0b2defd7c413b55766c4368e17e1238dfc3c8b81 | [
"MIT"
] | 29 | 2018-04-27T14:54:20.000Z | 2021-05-27T15:30:14.000Z | fog/cli/reporting/__init__.py | Yomguithereal/fog | 0b2defd7c413b55766c4368e17e1238dfc3c8b81 | [
"MIT"
] | 1 | 2019-11-27T18:14:49.000Z | 2019-11-27T18:14:49.000Z | from fog.cli.reporting.html import print_html_report
from fog.cli.reporting.toml import print_toml_report
RENDERERS = {
'html': print_html_report,
'toml': print_toml_report
}
| 23 | 52 | 0.777174 | from fog.cli.reporting.html import print_html_report
from fog.cli.reporting.toml import print_toml_report
RENDERERS = {
'html': print_html_report,
'toml': print_toml_report
}
| true | true |
1c3e06f946e218c016a2141becd3929738d428e9 | 15,736 | py | Python | python/plot3d/face.py | nasa/Plot3D_utilities | f71d612ff1c6969059cc199b4b84c2d85fdf0a87 | [
"MIT"
] | 11 | 2021-08-12T06:40:43.000Z | 2022-03-15T08:31:49.000Z | python/plot3d/face.py | nasa/Plot3D_utilities | f71d612ff1c6969059cc199b4b84c2d85fdf0a87 | [
"MIT"
] | 9 | 2021-09-30T05:39:25.000Z | 2022-02-01T18:14:15.000Z | python/plot3d/face.py | nasa/Plot3D_utilities | f71d612ff1c6969059cc199b4b84c2d85fdf0a87 | [
"MIT"
] | 7 | 2021-08-11T18:54:02.000Z | 2021-12-15T15:53:12.000Z | import itertools
from typing import Dict, List, Tuple
import numpy as np
from numpy.lib import math
from .block import Block
class Face:
"""Defines a Face of a block for example IMIN,JMIN,JMIN to IMAX,JMIN,JMIN
"""
def __init__(self,nvertex:int=4):
""" Defines a face using nvertex 4 = quad 3 = tria... | 35.203579 | 151 | 0.540036 | import itertools
from typing import Dict, List, Tuple
import numpy as np
from numpy.lib import math
from .block import Block
class Face:
def __init__(self,nvertex:int=4):
self.x = np.zeros(4)
self.y = np.zeros(4)
self.z = np.zeros(4)
self.I = np.zeros(4,dtype=np.int64)
... | true | true |
1c3e0768350d6a99e4f2e5e7c9299a051bd00318 | 1,234 | py | Python | piquipe/__init__.py | conn/python-piquipe | 9a8046473af2ec4c6b9eaf1df875af10f910a364 | [
"BSD-3-Clause"
] | null | null | null | piquipe/__init__.py | conn/python-piquipe | 9a8046473af2ec4c6b9eaf1df875af10f910a364 | [
"BSD-3-Clause"
] | null | null | null | piquipe/__init__.py | conn/python-piquipe | 9a8046473af2ec4c6b9eaf1df875af10f910a364 | [
"BSD-3-Clause"
] | null | null | null | import os
import threading
import queue
VERSION = '0.0.0'
def _forward_stream_to_queue(stream, queue_):
for line in iter(stream.readline, b''):
queue_.put(line)
def _forward_queue_to_stream(queue_, stream):
for line in iter(queue_.get, b''):
stream.write(line)
def _forward_p2q(read_fd, qu... | 24.68 | 88 | 0.725284 | import os
import threading
import queue
VERSION = '0.0.0'
def _forward_stream_to_queue(stream, queue_):
for line in iter(stream.readline, b''):
queue_.put(line)
def _forward_queue_to_stream(queue_, stream):
for line in iter(queue_.get, b''):
stream.write(line)
def _forward_p2q(read_fd, qu... | true | true |
1c3e0827f9792364d112de37b17170787e658b1d | 160 | py | Python | opendata_parser/parser/tokyo_covid19_patients_parser.py | sandfishfactory/opendata_parser | fc382978f62fe08c4c571827a233082d87e5d552 | [
"MIT"
] | null | null | null | opendata_parser/parser/tokyo_covid19_patients_parser.py | sandfishfactory/opendata_parser | fc382978f62fe08c4c571827a233082d87e5d552 | [
"MIT"
] | null | null | null | opendata_parser/parser/tokyo_covid19_patients_parser.py | sandfishfactory/opendata_parser | fc382978f62fe08c4c571827a233082d87e5d552 | [
"MIT"
] | null | null | null | from parser.base_parser import BaseParser
class TokyoCovid19PatientsParser(BaseParser):
def parse(self):
print("echo TokyoCovid19PatientsParser")
| 22.857143 | 48 | 0.78125 | from parser.base_parser import BaseParser
class TokyoCovid19PatientsParser(BaseParser):
def parse(self):
print("echo TokyoCovid19PatientsParser")
| true | true |
1c3e091a255af12b065fb8335e7ec92451820295 | 2,794 | py | Python | Image-Analysis/main.py | prashanth-acsq/Azure-Cognitive-Services | 69fc4317561c2b7fc469945d7e6c175c539d6e16 | [
"MIT"
] | 1 | 2022-03-21T10:29:17.000Z | 2022-03-21T10:29:17.000Z | Image-Analysis/main.py | prashanth-acsq/Azure-Cognitive-Services | 69fc4317561c2b7fc469945d7e6c175c539d6e16 | [
"MIT"
] | null | null | null | Image-Analysis/main.py | prashanth-acsq/Azure-Cognitive-Services | 69fc4317561c2b7fc469945d7e6c175c539d6e16 | [
"MIT"
] | 1 | 2022-03-13T10:27:30.000Z | 2022-03-13T10:27:30.000Z | """
Only Describing done in this script
"""
import os
import sys
import time
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes
from azure.cognitiveservices.vision.computervision.models import VisualF... | 36.285714 | 156 | 0.705082 |
import os
import sys
import time
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes
from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes
from msrest.authentication import Co... | true | true |
1c3e0925cbef89bed35f6999c5f306e7ff61d067 | 22,630 | py | Python | pyrs/proto/core_pb2.py | drbob/pyrs | 9adc07ff3bda6c382e73c47cb61c5be2000715ba | [
"BSD-3-Clause"
] | 3 | 2016-10-08T10:41:25.000Z | 2021-11-30T00:12:28.000Z | pyrs/proto/core_pb2.py | drbob/pyrs | 9adc07ff3bda6c382e73c47cb61c5be2000715ba | [
"BSD-3-Clause"
] | 1 | 2016-02-07T21:19:33.000Z | 2016-02-07T21:27:29.000Z | pyrs/proto/core_pb2.py | drbob/pyrs | 9adc07ff3bda6c382e73c47cb61c5be2000715ba | [
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='core.proto',
p... | 33.575668 | 2,514 | 0.715422 |
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
DESCRIPTOR = descriptor.FileDescriptor(
name='core.proto',
package='rsctrl.core',
serialized_pb='\n\ncore.proto\x12\x0brsctrl.core\"\xb0\x01\n\x06Statu... | true | true |
1c3e09b70eb2285e5866f9dbf407ea948980790e | 29,195 | py | Python | kivy/uix/tabbedpanel.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 6 | 2020-04-10T14:36:25.000Z | 2021-04-25T13:11:32.000Z | kivy/uix/tabbedpanel.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 6 | 2020-01-31T18:04:48.000Z | 2021-06-05T10:53:55.000Z | kivy/uix/tabbedpanel.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 1 | 2021-04-08T19:51:07.000Z | 2021-04-08T19:51:07.000Z | '''
TabbedPanel
===========
.. image:: images/tabbed_panel.jpg
:align: right
.. versionadded:: 1.3.0
The `TabbedPanel` widget manages different widgets in tabs, with a header area
for the actual tab buttons and a content area for showing the current tab
content.
The :class:`TabbedPanel` provides one default ta... | 34.306698 | 79 | 0.623703 |
__all__ = ('StripLayout', 'TabbedPanel', 'TabbedPanelContent',
'TabbedPanelHeader', 'TabbedPanelItem', 'TabbedPanelStrip',
'TabbedPanelException')
from functools import partial
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.factory import Factory
from kivy.uix.toggle... | true | true |
1c3e0b2b666c83d76275ef9410b970cce34e2b9b | 28,588 | py | Python | packages/python/yap_kernel/yap_ipython/lib/pretty.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 90 | 2015-03-09T01:24:15.000Z | 2022-02-24T13:56:25.000Z | packages/python/yap_kernel/yap_ipython/lib/pretty.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 52 | 2016-02-14T08:59:37.000Z | 2022-03-14T16:39:35.000Z | packages/python/yap_kernel/yap_ipython/lib/pretty.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 27 | 2015-11-19T02:45:49.000Z | 2021-11-25T19:47:58.000Z | # -*- coding: utf-8 -*-
"""
Python advanced pretty printer. This pretty printer is intended to
replace the old `pprint` python module which does not allow developers
to provide their own pretty print callbacks.
This module is based on ruby's `prettyprint.rb` library by `Tanaka Akira`.
Example Usage
-------------
T... | 32.784404 | 107 | 0.592661 |
from contextlib import contextmanager
import datetime
import os
import re
import sys
import types
from collections import deque
from io import StringIO
from warnings import warn
from yap_ipython.utils.decorators import undoc
from yap_ipython.utils.py3compat import PYPY
from yap_ipython.utils.signatures import signat... | true | true |
1c3e0c62fd5d4fd2b2c4c22ae84670c0a04b08a8 | 4,115 | py | Python | UI/CommandTypeEdit.py | mjbogusz/BTSerial | 141d37caaab860ba420c9584a2844c63bce401e3 | [
"MIT"
] | null | null | null | UI/CommandTypeEdit.py | mjbogusz/BTSerial | 141d37caaab860ba420c9584a2844c63bce401e3 | [
"MIT"
] | null | null | null | UI/CommandTypeEdit.py | mjbogusz/BTSerial | 141d37caaab860ba420c9584a2844c63bce401e3 | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QDialog, QInputDialog
from Commands.CommandType import CommandType
from Layouts.CommandTypeEditWidget import Ui_BTSerialCommandTypeEditDialog
class CommandTypeEdit(QDialog):
textType = True
def __init__(self, parent = None, name = None, code = None, description = None, textType = True):
... | 34.291667 | 138 | 0.730012 | from PyQt5.QtWidgets import QDialog, QInputDialog
from Commands.CommandType import CommandType
from Layouts.CommandTypeEditWidget import Ui_BTSerialCommandTypeEditDialog
class CommandTypeEdit(QDialog):
textType = True
def __init__(self, parent = None, name = None, code = None, description = None, textType = True):
... | true | true |
1c3e0c75f4c827241f9bc863cb01c17d1d23dd11 | 1,271 | py | Python | test/test_user_interface.py | t-keazirian/tic-tac-toe | df557aaa6f01e3bfaf68dea96f9994bc3815067b | [
"MIT"
] | null | null | null | test/test_user_interface.py | t-keazirian/tic-tac-toe | df557aaa6f01e3bfaf68dea96f9994bc3815067b | [
"MIT"
] | 5 | 2022-03-18T19:07:56.000Z | 2022-03-25T17:00:50.000Z | test/test_user_interface.py | t-keazirian/tic-tac-toe | df557aaa6f01e3bfaf68dea96f9994bc3815067b | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import patch
from src.user_interface import UserInterface
class TestUserInterface(unittest.TestCase):
@patch("builtins.print")
def test_display_message_prints_welcome_message_passed_in(self, mock_print):
user_interface = UserInterface()
message = "Welcome to... | 38.515152 | 85 | 0.685287 | import unittest
from unittest.mock import patch
from src.user_interface import UserInterface
class TestUserInterface(unittest.TestCase):
@patch("builtins.print")
def test_display_message_prints_welcome_message_passed_in(self, mock_print):
user_interface = UserInterface()
message = "Welcome to... | true | true |
1c3e0c870e78906f9031bc7fd02077d893973103 | 208 | py | Python | arcade/sprite_list/__init__.py | Mr-Coxall/arcade | 7767e9c7d7395c0dd35479744052f18ac8c86679 | [
"MIT"
] | null | null | null | arcade/sprite_list/__init__.py | Mr-Coxall/arcade | 7767e9c7d7395c0dd35479744052f18ac8c86679 | [
"MIT"
] | null | null | null | arcade/sprite_list/__init__.py | Mr-Coxall/arcade | 7767e9c7d7395c0dd35479744052f18ac8c86679 | [
"MIT"
] | null | null | null | from .sprite_list import SpriteList
from .spatial_hash import (
get_closest_sprite,
check_for_collision,
check_for_collision_with_list,
get_sprites_at_point,
get_sprites_at_exact_point,
)
| 23.111111 | 35 | 0.793269 | from .sprite_list import SpriteList
from .spatial_hash import (
get_closest_sprite,
check_for_collision,
check_for_collision_with_list,
get_sprites_at_point,
get_sprites_at_exact_point,
)
| true | true |
1c3e1011b841b916457c3c5d7830debe6c5af1cb | 2,060 | py | Python | setup.py | SynetoNet/graphite-api | 97f48ba73f4e08296e6eb6edb357e4a83d229066 | [
"Apache-2.0"
] | null | null | null | setup.py | SynetoNet/graphite-api | 97f48ba73f4e08296e6eb6edb357e4a83d229066 | [
"Apache-2.0"
] | null | null | null | setup.py | SynetoNet/graphite-api | 97f48ba73f4e08296e6eb6edb357e4a83d229066 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import sys
from setuptools import setup, find_packages
install_requires = [
'Flask',
'PyYAML',
'cairocffi',
'pyparsing',
'pytz',
'six',
'structlog',
'tzlocal',
]
if sys.version_info < (2, 7):
install_requires.append('importlib')
install_requires.append('logutil... | 30.294118 | 66 | 0.61068 |
import sys
from setuptools import setup, find_packages
install_requires = [
'Flask',
'PyYAML',
'cairocffi',
'pyparsing',
'pytz',
'six',
'structlog',
'tzlocal',
]
if sys.version_info < (2, 7):
install_requires.append('importlib')
install_requires.append('logutils')
install... | true | true |
1c3e103d8d9475f8cb7885293553b2416f9c9bf0 | 6,097 | py | Python | Lib/site-packages/PIL/SgiImagePlugin.py | F4Ruke/FF14FishingBot | 53f73b9db8a95b2b718a36a9746471046c45117d | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/PIL/SgiImagePlugin.py | F4Ruke/FF14FishingBot | 53f73b9db8a95b2b718a36a9746471046c45117d | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/PIL/SgiImagePlugin.py | F4Ruke/FF14FishingBot | 53f73b9db8a95b2b718a36a9746471046c45117d | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | #
# The Python Imaging Library.
# $Id$
#
# SGI image file handling
#
# See "The SGI Image File Format (Draft version 0.97)", Paul Haeberli.
# <ftp://ftp.sgi.com/graphics/SGIIMAGESPEC>
#
#
# History:
# 2017-22-07 mb Add RLE decompression
# 2016-16-10 mb Add save method without compression
# 1995-09-10 fl Created
#... | 26.393939 | 87 | 0.567656 |
import os
import struct
from . import Image, ImageFile
from ._binary import i16be as i16
from ._binary import o8
def _accept(prefix):
return len(prefix) >= 2 and i16(prefix) == 474
MODES = {
(1, 1, 1): "L",
(1, 2, 1): "L",
(2, 1, 1): "L;16B",
(2, 2, 1): "L;16B",
(1, ... | true | true |
1c3e1095736ca8d72a8d9945a79daf052743ef96 | 4,760 | py | Python | tests/test_validation.py | Pascal-Bliem/tox-block-api | 31bde9a018a6efdd7c887bfd5ef5f04f0a14fd8f | [
"MIT"
] | null | null | null | tests/test_validation.py | Pascal-Bliem/tox-block-api | 31bde9a018a6efdd7c887bfd5ef5f04f0a14fd8f | [
"MIT"
] | null | null | null | tests/test_validation.py | Pascal-Bliem/tox-block-api | 31bde9a018a6efdd7c887bfd5ef5f04f0a14fd8f | [
"MIT"
] | null | null | null | import json
def test_validate_multiple_inputs(flask_test_client):
# setup
no_list = 123
list_with_empty_string = ["a","","b"]
list_with_no_string = ["a",1,"b"]
empty_list = []
valid_list_of_strings = ["Hi","I'm","Pascal"]
# action
res_no_list = flask_test_client.post("/v1/make_pr... | 45.769231 | 123 | 0.668908 | import json
def test_validate_multiple_inputs(flask_test_client):
no_list = 123
list_with_empty_string = ["a","","b"]
list_with_no_string = ["a",1,"b"]
empty_list = []
valid_list_of_strings = ["Hi","I'm","Pascal"]
# action
res_no_list = flask_test_client.post("/v1/make_predictio... | true | true |
1c3e119050a4066467abd713ce404ac251447abd | 3,734 | py | Python | unit_tests/shared_functions_unittests.py | NOAA-OWP/inundation-mapping | 1820af99d91cede1de1b618fb5bca77bdd3e4b42 | [
"Info-ZIP"
] | 2 | 2022-02-11T21:34:47.000Z | 2022-02-11T21:34:49.000Z | unit_tests/shared_functions_unittests.py | NOAA-OWP/inundation-mapping | 1820af99d91cede1de1b618fb5bca77bdd3e4b42 | [
"Info-ZIP"
] | 35 | 2022-02-04T15:36:57.000Z | 2022-03-30T21:13:11.000Z | unit_tests/shared_functions_unittests.py | NOAA-OWP/inundation-mapping | 1820af99d91cede1de1b618fb5bca77bdd3e4b42 | [
"Info-ZIP"
] | 4 | 2022-02-11T21:46:49.000Z | 2022-03-24T08:42:56.000Z | #!/usr/bin/env python3
import inspect
import os
import sys
import argparse
import json
import warnings
import unittest
import unit_tests_utils as helpers
# importing python folders in other directories
sys.path.append('/foss_fim/src/utils')
import shared_functions as src
# NOTE: This goes directly to the function... | 31.91453 | 112 | 0.616229 |
import inspect
import os
import sys
import argparse
import json
import warnings
import unittest
import unit_tests_utils as helpers
sys.path.append('/foss_fim/src/utils')
import shared_functions as src
class test_shared_functions(unittest.TestCase):
@classmethod
def setUpClass(self):
warnings... | true | true |
1c3e12b5ec7e97e8a36c17cdf57ad8beb2b7828d | 558 | py | Python | problems/problem39.py | nolanwrightdev/blind-75-python | b92ef3449eb0143c760ddd339897a3f0a2972830 | [
"MIT"
] | 6 | 2020-02-01T23:29:51.000Z | 2022-02-20T20:46:56.000Z | problems/problem39.py | nolanwrightdev/blind-75-python | b92ef3449eb0143c760ddd339897a3f0a2972830 | [
"MIT"
] | null | null | null | problems/problem39.py | nolanwrightdev/blind-75-python | b92ef3449eb0143c760ddd339897a3f0a2972830 | [
"MIT"
] | null | null | null | '''
Blind Curated 75 - Problem 39
=============================
Find Minimum in Rotated Sorted Array
------------
Find the minimum element of an array sorted in ascending order but subsequently
rotated at some unknown pivot.
[→ LeetCode][1]
[1]: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
''... | 19.241379 | 79 | 0.625448 |
def solution(nums):
left, right = 0, len(nums) - 1
while left < right:
mid = (left + right) // 2
if nums[mid] > nums[right]:
left = mid + 1
else:
right = mid
return nums[left]
| true | true |
1c3e131d6b733d9550a9bf60e9bd68c91290d5f5 | 2,555 | py | Python | fix-requirements.py | geekinutah/docker-openstack-keystone-mitaka | 1b2ef17d916bd83bce36bd22a74dab9a2d1bef08 | [
"MIT"
] | null | null | null | fix-requirements.py | geekinutah/docker-openstack-keystone-mitaka | 1b2ef17d916bd83bce36bd22a74dab9a2d1bef08 | [
"MIT"
] | null | null | null | fix-requirements.py | geekinutah/docker-openstack-keystone-mitaka | 1b2ef17d916bd83bce36bd22a74dab9a2d1bef08 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import re
import argparse
import sys
from os import unlink
from shutil import copyfile
def get_vers(lines=[]):
version_map = {}
#lines look like this: alabaster (0.7.6)
r = re.compile('^(.+)\ \((.+)\)')
for l in lines:
m = r.match(l)
version_map[m.group(1)] = m.group(2)
re... | 32.75641 | 79 | 0.642661 |
import re
import argparse
import sys
from os import unlink
from shutil import copyfile
def get_vers(lines=[]):
version_map = {}
r = re.compile('^(.+)\ \((.+)\)')
for l in lines:
m = r.match(l)
version_map[m.group(1)] = m.group(2)
return version_map
def fix_reqs(requirements, version_map, di... | true | true |
1c3e1651db307de81ae66cc41cae8fbdf44bba86 | 13,906 | py | Python | tsdf/tsdf.py | changgyhub/semantic-tsdf | 4767d92a768af577f75ab05229c9fc87dda9681e | [
"BSD-2-Clause"
] | 9 | 2020-05-07T14:50:20.000Z | 2021-12-03T16:20:34.000Z | tsdf/tsdf.py | irsisyphus/semantic-tsdf | 4767d92a768af577f75ab05229c9fc87dda9681e | [
"BSD-2-Clause"
] | 1 | 2020-11-16T02:10:30.000Z | 2020-11-17T06:40:03.000Z | tsdf/tsdf.py | irsisyphus/semantic-tsdf | 4767d92a768af577f75ab05229c9fc87dda9681e | [
"BSD-2-Clause"
] | 1 | 2020-11-15T18:30:02.000Z | 2020-11-15T18:30:02.000Z | '''
TSDF fusion.
'''
import numpy as np
from skimage import measure
try:
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
TSDF_GPU_MODE = 1
except Exception as err:
print('Warning: %s'%(str(err)))
print('Failed to import PyCUDA. Running tsdf fusion in... | 56.299595 | 186 | 0.577161 |
import numpy as np
from skimage import measure
try:
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
TSDF_GPU_MODE = 1
except Exception as err:
print('Warning: %s'%(str(err)))
print('Failed to import PyCUDA. Running tsdf fusion in CPU mode.')
TSDF... | true | true |
1c3e169c43cdac142a1f05ac316cda7f81e2b59b | 2,997 | py | Python | YoloV3 SIMS/utils/bbox.py | bostankhan6/Object-Detection-YoloV3-RetinaNet-FasterRCNN | 81b79063f6ec5a76960018bdc1c37b17ce12dc67 | [
"MIT"
] | 4 | 2020-05-23T21:56:11.000Z | 2021-12-06T10:54:43.000Z | YoloV3 SIMS/utils/bbox.py | bostankhan6/Object-Detection-YoloV3-RetinaNet-FasterRCNN | 81b79063f6ec5a76960018bdc1c37b17ce12dc67 | [
"MIT"
] | 5 | 2020-09-26T01:05:55.000Z | 2022-02-10T01:31:21.000Z | YoloV3 SIMS/utils/bbox.py | bostankhan6/Object-Detection-YoloV3-RetinaNet-FasterRCNN | 81b79063f6ec5a76960018bdc1c37b17ce12dc67 | [
"MIT"
] | 1 | 2021-03-10T10:58:00.000Z | 2021-03-10T10:58:00.000Z | import numpy as np
import os
import cv2
from .colors import get_color
class BoundBox:
def __init__(self, xmin, ymin, xmax, ymax, c = None, classes = None):
self.xmin = xmin
self.ymin = ymin
self.xmax = xmax
self.ymax = ymax
self.c = c
self... | 33.674157 | 124 | 0.495162 | import numpy as np
import os
import cv2
from .colors import get_color
class BoundBox:
def __init__(self, xmin, ymin, xmax, ymax, c = None, classes = None):
self.xmin = xmin
self.ymin = ymin
self.xmax = xmax
self.ymax = ymax
self.c = c
self... | true | true |
1c3e1708ed91858e89b23f3225922ba20d396cb2 | 418 | py | Python | ray_tracer/tests/test_lights.py | jjason/RayTracerChallenge | ab3cea8968407426bddfa9e11319664fc0b595f6 | [
"MIT"
] | 1 | 2020-05-13T03:54:00.000Z | 2020-05-13T03:54:00.000Z | ray_tracer/tests/test_lights.py | jjason/RayTracerChallenge | ab3cea8968407426bddfa9e11319664fc0b595f6 | [
"MIT"
] | null | null | null | ray_tracer/tests/test_lights.py | jjason/RayTracerChallenge | ab3cea8968407426bddfa9e11319664fc0b595f6 | [
"MIT"
] | null | null | null | import unittest
from color import Color
from lights import PointLight
from point import Point
class TestPointLight(unittest.TestCase):
def test_create(self):
p = Point(x=0, y=0, z=0)
i = Color(red=1, green=1, blue=1)
l = PointLight(position=p, intensity=i)
self.assertEqual(p, l.po... | 22 | 47 | 0.662679 | import unittest
from color import Color
from lights import PointLight
from point import Point
class TestPointLight(unittest.TestCase):
def test_create(self):
p = Point(x=0, y=0, z=0)
i = Color(red=1, green=1, blue=1)
l = PointLight(position=p, intensity=i)
self.assertEqual(p, l.po... | true | true |
1c3e17e0fd18466449bd191129c98cee3777bac0 | 184 | py | Python | configs/fp16/pspnet_r101-d8_512x1024_80k_fp16_cityscapes.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | configs/fp16/pspnet_r101-d8_512x1024_80k_fp16_cityscapes.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | configs/fp16/pspnet_r101-d8_512x1024_80k_fp16_cityscapes.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | _base_ = '../pspnet/pspnet_r101-d8_512x1024_80k_cityscapes.py'
# fp16 settings
optimizer_config = dict(type='Fp16OptimizerHook', loss_scale=512.)
# fp16 placeholder
fp16 = dict()
| 30.666667 | 67 | 0.76087 | _base_ = '../pspnet/pspnet_r101-d8_512x1024_80k_cityscapes.py'
optimizer_config = dict(type='Fp16OptimizerHook', loss_scale=512.)
fp16 = dict()
| true | true |
1c3e1874abca09d7b3e122e2d6b52a8efec05ea1 | 97,128 | py | Python | mitogen/parent.py | percygrunwald/mitogen | 99c5cece3a69381cb02cf861d53045c8ea7e5369 | [
"BSD-3-Clause"
] | 4 | 2019-12-04T06:02:18.000Z | 2019-12-18T05:38:44.000Z | mitogen/parent.py | percygrunwald/mitogen | 99c5cece3a69381cb02cf861d53045c8ea7e5369 | [
"BSD-3-Clause"
] | 12 | 2020-05-13T18:56:22.000Z | 2021-12-21T17:51:11.000Z | mitogen/parent.py | eamanu/python-mitogen | e93c7aae83b130abe1ef2dcf829d32e40f9fe8b1 | [
"BSD-3-Clause"
] | 6 | 2020-05-13T12:08:41.000Z | 2021-03-31T21:40:57.000Z | # Copyright 2019, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... | 35.06426 | 83 | 0.625309 |
import codecs
import errno
import fcntl
import getpass
import heapq
import inspect
import logging
import os
import re
import signal
import socket
import struct
import subprocess
import sys
import termios
import textwrap
import threading
import zlib
select = __import__('select')
try:
... | true | true |
1c3e1ac1ffbcaae6a149c06bab5c2378e1b7ba27 | 5,010 | py | Python | bitflow-script/generated/python2/BitflowLexer.py | bitflow-stream/bitflow-script | b8427c02f65820108ca08356f9483e400fcbcaee | [
"Apache-2.0"
] | null | null | null | bitflow-script/generated/python2/BitflowLexer.py | bitflow-stream/bitflow-script | b8427c02f65820108ca08356f9483e400fcbcaee | [
"Apache-2.0"
] | null | null | null | bitflow-script/generated/python2/BitflowLexer.py | bitflow-stream/bitflow-script | b8427c02f65820108ca08356f9483e400fcbcaee | [
"Apache-2.0"
] | null | null | null | # Generated from Bitflow.g4 by ANTLR 4.7.1
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2")
buf.write(u"\23|\b\1\4\2\t\2\4\... | 46.388889 | 103 | 0.530539 |
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2")
buf.write(u"\23|\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7")
buf.write(u"\t\... | true | true |
1c3e1b0e4c49dc316f529abeabc20b804d687524 | 3,823 | py | Python | python/plugins/MetaSearch/plugin.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | python/plugins/MetaSearch/plugin.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | python/plugins/MetaSearch/plugin.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | 1 | 2021-12-25T08:40:30.000Z | 2021-12-25T08:40:30.000Z | from builtins import object
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2010 NextGIS (http://nextgis.org),
# Alexander Bruy (alexander.bruy@gmail.com),
# Maxim Dubinin (sim@gis-lab.info),
#
# Copyright (C... | 37.116505 | 92 | 0.610777 | from builtins import object
| true | true |
1c3e1b338819a66c4564a56099067a4c84d04ee3 | 1,520 | py | Python | rpi/sensors/APCUPS.py | brettonw/rpi_sensor | adb13e9b5c508fb31297cde2bc4d2c9fb156ce35 | [
"MIT"
] | null | null | null | rpi/sensors/APCUPS.py | brettonw/rpi_sensor | adb13e9b5c508fb31297cde2bc4d2c9fb156ce35 | [
"MIT"
] | null | null | null | rpi/sensors/APCUPS.py | brettonw/rpi_sensor | adb13e9b5c508fb31297cde2bc4d2c9fb156ce35 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import subprocess
# helper to print each field we care about
separator = ""
def printKeyValuePair (key, value):
global separator
print ("{}\"{}\":{}".format (separator, key, value), end='')
separator = ","
# the key names we want to report with
reportNames = {
"LINEV" : "li... | 33.043478 | 104 | 0.640789 |
import subprocess
separator = ""
def printKeyValuePair (key, value):
global separator
print ("{}\"{}\":{}".format (separator, key, value), end='')
separator = ","
reportNames = {
"LINEV" : "line/ Volts",
"LOADPCT" : "load/ Percent",
"BCHARGE" : "battery/ Percent",
"TIMELEFT" : "re... | true | true |
1c3e1b3965b8a20c4961feaf13b451c9a0104ae2 | 1,150 | py | Python | arp.py | victorpegoraro/net_scan_finder | b775f45f711c767c8447b9536cbb6aeaae68aede | [
"MIT"
] | 1 | 2020-05-02T21:11:26.000Z | 2020-05-02T21:11:26.000Z | arp.py | victorpegoraro/net_scan_finder | b775f45f711c767c8447b9536cbb6aeaae68aede | [
"MIT"
] | null | null | null | arp.py | victorpegoraro/net_scan_finder | b775f45f711c767c8447b9536cbb6aeaae68aede | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import scapy.all as scapy
import optparse
def get_args():
parser = optparse.OptionParser()
parser.add_option("-t", "--target", dest="ipaddr", help="Enter IP address or IP range EX: 192.168.0.1/24")
options, args = parser.parse_args()
if not options.ipaddr:
... | 20.175439 | 111 | 0.58087 |
import scapy.all as scapy
import optparse
def get_args():
parser = optparse.OptionParser()
parser.add_option("-t", "--target", dest="ipaddr", help="Enter IP address or IP range EX: 192.168.0.1/24")
options, args = parser.parse_args()
if not options.ipaddr:
parser.error("[-]... | true | true |
1c3e1bfd1ad36aeccf38bcff09387002aaceb2d4 | 3,011 | py | Python | ilpyt/nets/base_net.py | mitre/ilpyt | 6aecbe414f0032514ffb4206200596b8c3860b58 | [
"Apache-2.0"
] | 6 | 2021-09-20T20:25:11.000Z | 2022-01-05T16:04:04.000Z | ilpyt/nets/base_net.py | mitre/ilpyt | 6aecbe414f0032514ffb4206200596b8c3860b58 | [
"Apache-2.0"
] | null | null | null | ilpyt/nets/base_net.py | mitre/ilpyt | 6aecbe414f0032514ffb4206200596b8c3860b58 | [
"Apache-2.0"
] | null | null | null | """
`BaseNetwork` is the abstract class for a network. Networks parameterize
important functions during learning - most often, the agent policy.
To create a custom network, simply extend `BaseNetwork`. The `BaseNetwork` API
requires you to override the `initialize`, `get_action`, and `forward` methods.
- `initalize... | 27.126126 | 80 | 0.608436 |
from abc import abstractmethod
from typing import Any, Tuple
import torch
from torch.distributions import Distribution
class BaseNetwork(torch.nn.Module):
def __init__(self, **kwargs: Any) -> None:
super(BaseNetwork, self).__init__()
self.initialize(**kwargs)
@abstractmethod
def initial... | true | true |
1c3e1c869cdf07b28cae0a81ca5128160b7caace | 3,983 | py | Python | appweb/website/auth.py | francescofranzese004/fitness_progetto | fc9d2816b397348a7337e307e489ec8132827a8e | [
"Apache-2.0"
] | null | null | null | appweb/website/auth.py | francescofranzese004/fitness_progetto | fc9d2816b397348a7337e307e489ec8132827a8e | [
"Apache-2.0"
] | null | null | null | appweb/website/auth.py | francescofranzese004/fitness_progetto | fc9d2816b397348a7337e307e489ec8132827a8e | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint, render_template, request, flash, redirect, url_for
from . import db
from .models import User, Prenotazione
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import login_user, current_user
from datetime import datetime
#Il seguente file esegu... | 51.727273 | 187 | 0.657796 | from flask import Blueprint, render_template, request, flash, redirect, url_for
from . import db
from .models import User, Prenotazione
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import login_user, current_user
from datetime import datetime
auth = Blueprint... | true | true |
1c3e1cc3b9ce9d896e34e0783065966ba48012ce | 1,494 | py | Python | controllers/pwm_dimmer.py | stas-demydiuk/domoticz-h801-tasmota-plugin | f982d1a7a9aaec88b24d6537af1198e870564d65 | [
"MIT"
] | 8 | 2018-05-26T00:00:02.000Z | 2019-11-17T06:23:18.000Z | controllers/pwm_dimmer.py | stas-demydiuk/domoticz-h801-tasmota-plugin | f982d1a7a9aaec88b24d6537af1198e870564d65 | [
"MIT"
] | 4 | 2018-10-22T14:44:35.000Z | 2021-05-05T17:31:46.000Z | controllers/pwm_dimmer.py | stas-demydiuk/domoticz-h801-tasmota-plugin | f982d1a7a9aaec88b24d6537af1198e870564d65 | [
"MIT"
] | 2 | 2018-12-27T19:54:27.000Z | 2019-09-28T09:05:16.000Z | import Domoticz
from devices_manager import DevicesManager
class PwmDimmer:
def __init__(self, devices_manager, mode):
self.mode = mode
self.devices_manager = devices_manager
def checkDevices(self):
for unit in range(1, 6):
if not self.devices_manager.has_device(unit):
... | 37.35 | 129 | 0.599063 | import Domoticz
from devices_manager import DevicesManager
class PwmDimmer:
def __init__(self, devices_manager, mode):
self.mode = mode
self.devices_manager = devices_manager
def checkDevices(self):
for unit in range(1, 6):
if not self.devices_manager.has_device(unit):
... | true | true |
1c3e1d15c02db0b45bd299c37ca123d2d5d9b146 | 839 | py | Python | model_vision/src/test.py | diffunity/kpmg-corona-blue | 93c063933981009af8d661b9b91dda5e2ebf68ab | [
"MIT"
] | 3 | 2021-10-05T07:47:03.000Z | 2021-10-05T10:32:40.000Z | model_vision/src/test.py | diffunity/kpmg-corona-blue | 93c063933981009af8d661b9b91dda5e2ebf68ab | [
"MIT"
] | 6 | 2021-02-07T14:56:57.000Z | 2021-02-20T05:07:35.000Z | model_vision/src/test.py | diffunity/kpmg-corona-blue | 93c063933981009af8d661b9b91dda5e2ebf68ab | [
"MIT"
] | 1 | 2021-02-20T05:59:27.000Z | 2021-02-20T05:59:27.000Z | import sys
import yaml
import unittest
import numpy as np
from model import model
class Test(unittest.TestCase):
def setUp(self):
configs = yaml.load(open("./conf/config.yml").read(), Loader=yaml.Loader)
self.test_configs = configs["unittest_settings"]
self.model = model()
def test_c... | 26.21875 | 124 | 0.628129 | import sys
import yaml
import unittest
import numpy as np
from model import model
class Test(unittest.TestCase):
def setUp(self):
configs = yaml.load(open("./conf/config.yml").read(), Loader=yaml.Loader)
self.test_configs = configs["unittest_settings"]
self.model = model()
def test_c... | true | true |
1c3e1d3cb4937a0f1594aea801006e01a1c0cd0e | 11,882 | py | Python | gui/host_manager/remote_file_dialog.py | anglebinbin/Barista-tool | 2d51507fb3566881923f0b273127f59d23ed317f | [
"MIT"
] | 1 | 2020-02-11T19:05:17.000Z | 2020-02-11T19:05:17.000Z | gui/host_manager/remote_file_dialog.py | anglebinbin/Barista-tool | 2d51507fb3566881923f0b273127f59d23ed317f | [
"MIT"
] | null | null | null | gui/host_manager/remote_file_dialog.py | anglebinbin/Barista-tool | 2d51507fb3566881923f0b273127f59d23ed317f | [
"MIT"
] | null | null | null | from os.path import normpath
from PyQt5.QtCore import QAbstractTableModel, Qt, QModelIndex, pyqtSignal
from PyQt5.QtGui import QColor, QIcon
from PyQt5.QtWidgets import QDialog, QGridLayout, QTableView, QAbstractItemView, QComboBox, QPushButton, QLineEdit, \
QStyle, qApp, QFileIconProvider, QLabel
from backend.net... | 39.214521 | 117 | 0.602087 | from os.path import normpath
from PyQt5.QtCore import QAbstractTableModel, Qt, QModelIndex, pyqtSignal
from PyQt5.QtGui import QColor, QIcon
from PyQt5.QtWidgets import QDialog, QGridLayout, QTableView, QAbstractItemView, QComboBox, QPushButton, QLineEdit, \
QStyle, qApp, QFileIconProvider, QLabel
from backend.net... | true | true |
1c3e1d8084f6cdd2fd41504684374440dda47dc1 | 595 | py | Python | Basics/Loops.py | spirulinax/PyHub | ae92c249224013f86c06b4d6cec3c6caa2e18c4d | [
"MIT"
] | 1 | 2020-11-09T14:13:45.000Z | 2020-11-09T14:13:45.000Z | Basics/Loops.py | spirulinax/PyHub | ae92c249224013f86c06b4d6cec3c6caa2e18c4d | [
"MIT"
] | null | null | null | Basics/Loops.py | spirulinax/PyHub | ae92c249224013f86c06b4d6cec3c6caa2e18c4d | [
"MIT"
] | null | null | null | # While Loops :
i = 1
while i<11:
print(i)
i += 1
print()
# For Loops :
#Looping through lists:
greetings = ["Hello","World","!!!"]
for x in greetings: #Loops through elements of the list.
print(x)
print()
#Looping through a string:
for x in "hello": #Loops through characters in... | 18.030303 | 68 | 0.571429 |
i = 1
while i<11:
print(i)
i += 1
print()
greetings = ["Hello","World","!!!"]
for x in greetings:
print(x)
print()
for x in "hello":
print(x)
print()
for x in range(6):
print(x)
print()
for x in range(1, 6):
print(x)
print()
for x in range(0,... | true | true |
1c3e1dd507d94b1adb0eb7905ef870b84330df89 | 4,943 | py | Python | elephantblog/models.py | sbaechler/feincms-elephantblog | d3d1824d1781cfa0f81d6cf16577f8e540fc1441 | [
"BSD-3-Clause"
] | null | null | null | elephantblog/models.py | sbaechler/feincms-elephantblog | d3d1824d1781cfa0f81d6cf16577f8e540fc1441 | [
"BSD-3-Clause"
] | null | null | null | elephantblog/models.py | sbaechler/feincms-elephantblog | d3d1824d1781cfa0f81d6cf16577f8e540fc1441 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.template.defaultfilters import slugify
from django.utils import timezone
from django.utils.encoding import pytho... | 32.097403 | 75 | 0.680963 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.template.defaultfilters import slugify
from django.utils import timezone
from django.utils.encoding import pytho... | true | true |
1c3e1e8e68d04871f96f80f4048970726b75f266 | 2,202 | py | Python | unified_mem_benchmark.py | tcapelle/tf-metal-experiments | d296ba2656dd352947ed8f6f80bdb349c1ab9617 | [
"MIT"
] | 96 | 2021-10-29T20:43:03.000Z | 2022-03-30T06:37:04.000Z | unified_mem_benchmark.py | tcapelle/tf-metal-experiments | d296ba2656dd352947ed8f6f80bdb349c1ab9617 | [
"MIT"
] | 10 | 2021-11-01T20:40:29.000Z | 2022-03-08T19:32:30.000Z | unified_mem_benchmark.py | tcapelle/tf-metal-experiments | d296ba2656dd352947ed8f6f80bdb349c1ab9617 | [
"MIT"
] | 10 | 2021-10-30T10:38:33.000Z | 2022-02-01T16:51:04.000Z | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--iterations", default=30, type=int,
help="Number of iterations to run within each benchmark")
parser.add_argument("--device1", default="/CPU:0", type=str)
parser.add_argument("--device2", default="/GPU:0", type=str)
args = pars... | 27.525 | 82 | 0.624432 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--iterations", default=30, type=int,
help="Number of iterations to run within each benchmark")
parser.add_argument("--device1", default="/CPU:0", type=str)
parser.add_argument("--device2", default="/GPU:0", type=str)
args = pars... | true | true |
1c3e1ef481efd0b6d4af937e7c92fac238269f9d | 409 | py | Python | tob-api/api_v2/models/Name.py | andrewwhitehead/TheOrgBook | 5a3dcd27cdcda0a3e19a68597a49997c68143ddc | [
"Apache-2.0"
] | null | null | null | tob-api/api_v2/models/Name.py | andrewwhitehead/TheOrgBook | 5a3dcd27cdcda0a3e19a68597a49997c68143ddc | [
"Apache-2.0"
] | 37 | 2019-03-12T20:10:57.000Z | 2020-11-26T18:39:51.000Z | tob-api/api_v2/models/Name.py | andrewwhitehead/TheOrgBook | 5a3dcd27cdcda0a3e19a68597a49997c68143ddc | [
"Apache-2.0"
] | 5 | 2019-02-26T17:38:37.000Z | 2020-11-26T14:48:03.000Z | from django.db import models
from .Auditable import Auditable
from .Credential import Credential
class Name(Auditable):
reindex_related = ['credential']
credential = models.ForeignKey(Credential, related_name="names", on_delete=models.CASCADE)
text = models.TextField(null=True)
language = models.Te... | 22.722222 | 94 | 0.706601 | from django.db import models
from .Auditable import Auditable
from .Credential import Credential
class Name(Auditable):
reindex_related = ['credential']
credential = models.ForeignKey(Credential, related_name="names", on_delete=models.CASCADE)
text = models.TextField(null=True)
language = models.Te... | true | true |
1c3e1f3af038eae1a91fa09018acf8d869c54d78 | 98 | py | Python | 32.operacoes_com_tuplas/13.update.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | 32.operacoes_com_tuplas/13.update.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | 32.operacoes_com_tuplas/13.update.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | set_5={1,2,3,4,5}
set_3={1,2,3,4,7,0,9}
print(set_5)
print(set_3)
set_5.update(set_3)
print(set_5) | 16.333333 | 21 | 0.693878 | set_5={1,2,3,4,5}
set_3={1,2,3,4,7,0,9}
print(set_5)
print(set_3)
set_5.update(set_3)
print(set_5) | true | true |
1c3e1f48043047ffba0468863f386bf3937fe9a6 | 4,984 | py | Python | example_ticker_and_miniticker.py | esquire900/unicorn-binance-websocket-api | 0b519561cde4ed49a4aac039a996b188bfb4f521 | [
"MIT"
] | 404 | 2019-11-13T02:22:39.000Z | 2021-12-31T08:48:10.000Z | example_ticker_and_miniticker.py | gladiopeace/unicorn-binance-websocket-api | 5bddc943343766210e8635d551084e566ffe0c21 | [
"MIT"
] | 181 | 2019-11-02T21:10:17.000Z | 2021-12-31T12:55:51.000Z | example_ticker_and_miniticker.py | gladiopeace/unicorn-binance-websocket-api | 5bddc943343766210e8635d551084e566ffe0c21 | [
"MIT"
] | 103 | 2019-11-16T23:39:24.000Z | 2021-12-28T05:15:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_ticker_and_miniticker.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: htt... | 48.38835 | 120 | 0.675161 |
from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager
import os
import time
import threading
import logging
from example_process_streams import BinanceWebSocketApiProcessStreams
onfig(level=logging.DEBUG,
file... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.