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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7456fe5d61cd5715a7df3f5e12c7b3d41f8e356 | 1,107 | py | Python | mopidy_gmusic/commands.py | jacobobryant/mopidy-gmusic | 646fa6ebdf5381b4e7abdcf9a33f93fe122f68fe | [
"Apache-2.0"
] | null | null | null | mopidy_gmusic/commands.py | jacobobryant/mopidy-gmusic | 646fa6ebdf5381b4e7abdcf9a33f93fe122f68fe | [
"Apache-2.0"
] | null | null | null | mopidy_gmusic/commands.py | jacobobryant/mopidy-gmusic | 646fa6ebdf5381b4e7abdcf9a33f93fe122f68fe | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from oauth2client.client import OAuth2WebServerFlow
import gmusicapi
from mopidy import commands
class GMusicCommand(commands.Command):
def __init__(self):
super(GMusicCommand, self).__init__()
self.add_child('login', LoginCommand())
class LoginCommand(co... | 30.75 | 76 | 0.65131 | from __future__ import print_function
from oauth2client.client import OAuth2WebServerFlow
import gmusicapi
from mopidy import commands
class GMusicCommand(commands.Command):
def __init__(self):
super(GMusicCommand, self).__init__()
self.add_child('login', LoginCommand())
class LoginCommand(co... | true | true |
f7456fe98798d9817b89bca1a7905a31d2e01bc6 | 24,408 | py | Python | tzpgc_2016/include/design.py | mpatacchiola/naogui | 2c71c82362edcf66b1a24a5f2af23e9719011146 | [
"MIT"
] | 2 | 2017-12-22T14:33:07.000Z | 2020-07-23T09:35:59.000Z | tzpgc_2016/include/design.py | mpatacchiola/naogui | 2c71c82362edcf66b1a24a5f2af23e9719011146 | [
"MIT"
] | null | null | null | tzpgc_2016/include/design.py | mpatacchiola/naogui | 2c71c82362edcf66b1a24a5f2af23e9719011146 | [
"MIT"
] | 4 | 2016-04-01T10:02:39.000Z | 2018-04-14T08:05:20.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '../include/mainwindow.ui'
#
# Created: Wed Mar 30 17:46:45 2016
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8... | 57.161593 | 203 | 0.696534 |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _enc... | true | true |
f7457113babcdb8375c142c5d21daefd5ec812a2 | 5,313 | py | Python | meerkat/thermistor.py | crdietrich/meerkat | 33f4e10fc7f0bbece79e4aefd7da179aa4574e52 | [
"MIT"
] | 2 | 2019-09-30T02:04:23.000Z | 2020-02-23T19:28:59.000Z | meerkat/thermistor.py | crdietrich/meerkat | 33f4e10fc7f0bbece79e4aefd7da179aa4574e52 | [
"MIT"
] | 1 | 2020-07-20T03:36:34.000Z | 2020-08-03T04:26:01.000Z | meerkat/thermistor.py | crdietrich/meerkat | 33f4e10fc7f0bbece79e4aefd7da179aa4574e52 | [
"MIT"
] | 1 | 2020-07-20T02:53:03.000Z | 2020-07-20T02:53:03.000Z | """Thermistor calculation methods, Semitec 103AT-2 thermistor using
ADS1x15 ADC I2C Driver for Raspberry PI & MicroPython"""
from math import log
def steinhart_hart(r, a, b, c, degrees='celcius'):
"""Calculate temperature from a resistance based on the
Steinhart-Hart equation. Defaults to degres in Celcius
... | 28.260638 | 115 | 0.507811 |
from math import log
def steinhart_hart(r, a, b, c, degrees='celcius'):
t = 1.0 / (a + b * log(r) + c * (log(r) ** 3))
if degrees == 'celcius':
t = KtoC(t)
return t
def KtoC(k):
return k - 273.15
def CtoK(k):
return k + 273.15
def compose_array(t1, t2, t3, r1, r2, r3, degrees='celci... | true | true |
f74571b92ad819244cf77ecdc54c443cd31335e6 | 9,968 | py | Python | libcloud/test/dns/test_hostvirtual.py | llambiel/libcloud | 7123206a9ee32333da7fc92905acb0bb16d37d0a | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | libcloud/test/dns/test_hostvirtual.py | llambiel/libcloud | 7123206a9ee32333da7fc92905acb0bb16d37d0a | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | libcloud/test/dns/test_hostvirtual.py | llambiel/libcloud | 7123206a9ee32333da7fc92905acb0bb16d37d0a | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 38.486486 | 77 | 0.647673 |
import sys
import unittest
from libcloud.utils.py3 import httplib
from libcloud.dns.types import RecordType, ZoneDoesNotExistError
from libcloud.dns.types import RecordDoesNotExistError
from libcloud.dns.drivers.hostvirtual import HostVirtualDNSDriver
from libcloud.test import MockHttp
from libcloud.te... | true | true |
f745721ef2879cb2ebc492780afa09430d860ef4 | 1,197 | py | Python | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/9_features/numtrees_45/rule_31.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/9_features/numtrees_45/rule_31.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/9_features/numtrees_45/rule_31.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Restaurant20to50, obj[7]: Direction_same, obj[8]: Distance
# {"feature": "Direction_same", "instances": 23, "metric_value": 0.9986, "depth": 1}
if obj[7]<=0:
# {"feature": "Coupon", "... | 36.272727 | 191 | 0.581454 | def findDecision(obj):
if obj[7]<=0:
if obj[2]>0:
if obj[4]>1:
if obj[6]>0.0:
if obj[1]>0:
return 'True'
elif obj[1]<=0:
if obj[3]>2:
return 'False'
elif obj[3]<=2:
return 'True'
else: return 'True'
else: return 'False'
elif ... | true | true |
f74572c6f50b8bb296b7be3c548db46ff24a80a0 | 28,973 | py | Python | netbox/dcim/migrations/0071_device_components_add_description_squashed_0088_powerfeed_available_power.py | BrnoPCmaniak/netbox | 7b517abdb68a6324950dfd0375861163c7bfff00 | [
"Apache-2.0"
] | 1 | 2021-09-23T00:06:51.000Z | 2021-09-23T00:06:51.000Z | netbox/dcim/migrations/0071_device_components_add_description_squashed_0088_powerfeed_available_power.py | BrnoPCmaniak/netbox | 7b517abdb68a6324950dfd0375861163c7bfff00 | [
"Apache-2.0"
] | 2 | 2021-06-08T21:05:10.000Z | 2021-09-08T01:46:58.000Z | netbox/dcim/migrations/0071_device_components_add_description_squashed_0088_powerfeed_available_power.py | BrnoPCmaniak/netbox | 7b517abdb68a6324950dfd0375861163c7bfff00 | [
"Apache-2.0"
] | null | null | null | import sys
import django.core.validators
import django.db.models.deletion
import taggit.managers
from django.db import migrations, models
SITE_STATUS_CHOICES = (
(1, 'active'),
(2, 'planned'),
(4, 'retired'),
)
RACK_TYPE_CHOICES = (
(100, '2-post-frame'),
(200, '4-post-frame'),
(300, '4-post-... | 34.491667 | 763 | 0.602078 | import sys
import django.core.validators
import django.db.models.deletion
import taggit.managers
from django.db import migrations, models
SITE_STATUS_CHOICES = (
(1, 'active'),
(2, 'planned'),
(4, 'retired'),
)
RACK_TYPE_CHOICES = (
(100, '2-post-frame'),
(200, '4-post-frame'),
(300, '4-post-... | true | true |
f74572ddb69210ace109e7c28c04a4805203d3f1 | 54,677 | py | Python | python/craftassist/ttad/generation_dialogues/templates/dig_templates.py | satyamedh/craftassist | d97cbc14bc25149d3ef41737231ab9f3cb7e392a | [
"MIT"
] | null | null | null | python/craftassist/ttad/generation_dialogues/templates/dig_templates.py | satyamedh/craftassist | d97cbc14bc25149d3ef41737231ab9f3cb7e392a | [
"MIT"
] | null | null | null | python/craftassist/ttad/generation_dialogues/templates/dig_templates.py | satyamedh/craftassist | d97cbc14bc25149d3ef41737231ab9f3cb7e392a | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
# fmt: off
'''
Every template contains an ordered list of TemplateObjects.
TemplateObject is defined in template_objects.py
Dig templates are written for a Location and represent the intent
for the action: Dig. This action intends to dig a hole at a certain loc... | 81.974513 | 153 | 0.786327 |
from template_objects import *
DIG_WITH_CORRECTION = [
plate, LocationMobTemplate, Please]],
[[Human, Dig, DigDimensions, DigSomeShape, NTimes],
[HumanReplace, RelativeDirectionTemplate, LocationMobTemplate, Please]],
[[Human, Dig, DigAbstractSize, DigSomeShape, NTimes],
[HumanReplace, Relati... | true | true |
f74573b52638d503ce8ae74bad9ae3ab15507b34 | 2,239 | py | Python | corporative/forms.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 5 | 2018-08-07T07:01:04.000Z | 2021-03-19T00:16:59.000Z | corporative/forms.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 1 | 2018-04-30T07:27:03.000Z | 2018-04-30T07:27:03.000Z | corporative/forms.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 3 | 2018-08-08T11:57:01.000Z | 2020-10-02T05:42:13.000Z | from django import forms
from django.utils.translation import ugettext as _
from .models import LegalItem
from app.validators import FileSizeValidator
class LegalItemForm(forms.ModelForm):
"""
Legal item update form. Only platform administrator
users can submit this form. The 'notify_users' field
mus... | 24.877778 | 73 | 0.601608 | from django import forms
from django.utils.translation import ugettext as _
from .models import LegalItem
from app.validators import FileSizeValidator
class LegalItemForm(forms.ModelForm):
notify_users = forms.BooleanField(
required=False,
label=_('notify users'),
help_text=_('Check it to... | true | true |
f74573c4b881d2713b8abda7ad81caca155bd168 | 24,093 | py | Python | bshmodules/s411objects.py | noiromo/S-411_Ice_Loader | 7165211d81f832cb721d802a910178c6d2e100b7 | [
"MIT"
] | 2 | 2020-04-04T15:09:44.000Z | 2021-01-04T06:00:02.000Z | bshmodules/s411objects.py | noiromo/S-411_Ice_Loader | 7165211d81f832cb721d802a910178c6d2e100b7 | [
"MIT"
] | 1 | 2019-12-23T17:02:19.000Z | 2020-04-20T09:48:33.000Z | bshmodules/s411objects.py | noiromo/S-411_Ice_Loader | 7165211d81f832cb721d802a910178c6d2e100b7 | [
"MIT"
] | 1 | 2022-02-09T02:44:35.000Z | 2022-02-09T02:44:35.000Z | class IceFeature(object):
def __init__(self):
self.gmlId = None
self.geometry = None
def get_geometry(self):
return self.__geometry
def set_geometry(self, value):
self.__geometry = value
def get_gml_id(self):
return self.__gmlI... | 16.513365 | 56 | 0.585896 | class IceFeature(object):
def __init__(self):
self.gmlId = None
self.geometry = None
def get_geometry(self):
return self.__geometry
def set_geometry(self, value):
self.__geometry = value
def get_gml_id(self):
return self.__gmlI... | true | true |
f7457496fd5628407e4f19f1ab888f3934a8c82e | 19,670 | py | Python | 9z_ENSO_spatial_maps.py | nicpittman/tropical_pacific_carbon_export | eacd3e0382616388f418eb21cad859fe7ae0144a | [
"Apache-2.0"
] | null | null | null | 9z_ENSO_spatial_maps.py | nicpittman/tropical_pacific_carbon_export | eacd3e0382616388f418eb21cad859fe7ae0144a | [
"Apache-2.0"
] | null | null | null | 9z_ENSO_spatial_maps.py | nicpittman/tropical_pacific_carbon_export | eacd3e0382616388f418eb21cad859fe7ae0144a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 1 10:40:28 2020
@author: Nic Pittman
This code will reproduce Figure 4 in Pittman et al., 2021.
Trends and pvalues are calculated on the fly and not saved anywhere, however could be done easily.
regridded data is required for this process
This ... | 36.697761 | 183 | 0.578139 |
import numpy as np
import pandas as pd
import xarray as xr
import matplotlib.pyplot as plt
from carbon_math import *
from mpl_toolkits.basemap import Basemap
from scipy.stats import linregress
def plot_basemap():
m = Basemap(llcrnrlon=120.,llcrnrlat=-15,urcrnrlon=290,urcrnrlat=15.01,
resolu... | true | true |
f74574a3b1cd0e69bfe90925b198771d9b962996 | 1,559 | py | Python | CLIP-ViL-VLN/modify.py | OdedH/CLIP-ViL | 05180f64eef8365b9efae636eaaa88903ceb83f6 | [
"MIT"
] | 220 | 2021-06-18T19:16:49.000Z | 2022-03-30T09:41:29.000Z | CLIP-ViL-VLN/modify.py | OdedH/CLIP-ViL | 05180f64eef8365b9efae636eaaa88903ceb83f6 | [
"MIT"
] | 21 | 2021-07-14T18:01:26.000Z | 2022-01-27T03:04:56.000Z | CLIP-ViL-VLN/modify.py | OdedH/CLIP-ViL | 05180f64eef8365b9efae636eaaa88903ceb83f6 | [
"MIT"
] | 19 | 2021-07-15T04:29:42.000Z | 2022-02-22T21:54:45.000Z | import os
import shutil
import argparse
ORIG_FEAT = 'ResNet-152-imagenet'
parser = argparse.ArgumentParser()
parser.add_argument("--name", default="ResNet-152-imagenet")
parser.add_argument("--dim", default="2048")
parser.add_argument("--src-dir", default="r2r_src")
args = parser.parse_args()
print("Get ORIG files:... | 29.980769 | 78 | 0.597178 | import os
import shutil
import argparse
ORIG_FEAT = 'ResNet-152-imagenet'
parser = argparse.ArgumentParser()
parser.add_argument("--name", default="ResNet-152-imagenet")
parser.add_argument("--dim", default="2048")
parser.add_argument("--src-dir", default="r2r_src")
args = parser.parse_args()
print("Get ORIG files:... | true | true |
f745757955509a795ad1c7e9d15a5b2d89524dad | 4,110 | py | Python | redis/commands/sentinel.py | Avital-Fine/redis-py | 42b937fa1f73f3e8251eba5ec8ead2fcbaec7c50 | [
"MIT"
] | 483 | 2021-10-11T22:11:32.000Z | 2022-03-31T20:30:32.000Z | redis/commands/sentinel.py | Avital-Fine/redis-py | 42b937fa1f73f3e8251eba5ec8ead2fcbaec7c50 | [
"MIT"
] | 423 | 2021-10-13T09:07:29.000Z | 2022-03-31T09:13:03.000Z | redis/commands/sentinel.py | Avital-Fine/redis-py | 42b937fa1f73f3e8251eba5ec8ead2fcbaec7c50 | [
"MIT"
] | 148 | 2021-10-19T09:43:51.000Z | 2022-03-30T16:35:53.000Z | import warnings
class SentinelCommands:
"""
A class containing the commands specific to redis sentinel. This class is
to be used as a mixin.
"""
def sentinel(self, *args):
"""Redis Sentinel's SENTINEL command."""
warnings.warn(DeprecationWarning("Use the individual sentinel_* meth... | 41.1 | 85 | 0.688808 | import warnings
class SentinelCommands:
def sentinel(self, *args):
warnings.warn(DeprecationWarning("Use the individual sentinel_* methods"))
def sentinel_get_master_addr_by_name(self, service_name):
return self.execute_command("SENTINEL GET-MASTER-ADDR-BY-NAME", service_name)
def senti... | true | true |
f74575883974a64ff5e0413b795eba18040f3842 | 3,360 | py | Python | autotest/t011_test.py | jdlarsen-UA/flopy | bf2c59aaa689de186bd4c80685532802ac7149cd | [
"CC0-1.0",
"BSD-3-Clause"
] | 351 | 2015-01-03T15:18:48.000Z | 2022-03-31T09:46:43.000Z | autotest/t011_test.py | jdlarsen-UA/flopy | bf2c59aaa689de186bd4c80685532802ac7149cd | [
"CC0-1.0",
"BSD-3-Clause"
] | 1,256 | 2015-01-15T21:10:42.000Z | 2022-03-31T22:43:06.000Z | autotest/t011_test.py | jdlarsen-UA/flopy | bf2c59aaa689de186bd4c80685532802ac7149cd | [
"CC0-1.0",
"BSD-3-Clause"
] | 553 | 2015-01-31T22:46:48.000Z | 2022-03-31T17:43:35.000Z | """
Some basic tests for mflistfile.py module (not super rigorous)
"""
import os
import flopy
import numpy as np
from nose.tools import raises
def test_mflistfile():
pth = os.path.join("..", "examples", "data", "freyberg")
list_file = os.path.join(pth, "freyberg.gitlist")
assert os.path.exists(list_file... | 25.074627 | 66 | 0.639881 |
import os
import flopy
import numpy as np
from nose.tools import raises
def test_mflistfile():
pth = os.path.join("..", "examples", "data", "freyberg")
list_file = os.path.join(pth, "freyberg.gitlist")
assert os.path.exists(list_file)
mflist = flopy.utils.MfListBudget(list_file)
names = mflist.g... | true | true |
f74575e217117382d68ea0a38063cb0901a9040c | 3,882 | py | Python | getBalamsatData.py | fernandorazon/blmsat | 37b2c81d7d7760fb4a76e819fb386ac9184d54f6 | [
"MIT"
] | null | null | null | getBalamsatData.py | fernandorazon/blmsat | 37b2c81d7d7760fb4a76e819fb386ac9184d54f6 | [
"MIT"
] | null | null | null | getBalamsatData.py | fernandorazon/blmsat | 37b2c81d7d7760fb4a76e819fb386ac9184d54f6 | [
"MIT"
] | null | null | null |
from cansat import ReadLog
import re
import math as m
temperatura = []
presion = []
aceleracion = []
ax = []
ay = []
az = []
orientacion = []
orientacionFloat =[]
oy = []
oz =[]
alt = []
cont = 0
#Esta funcion valida que los datos del documento sean numeros
#Si no lo son retorna un string Nan
#NO... | 24.726115 | 96 | 0.648377 |
from cansat import ReadLog
import re
import math as m
temperatura = []
presion = []
aceleracion = []
ax = []
ay = []
az = []
orientacion = []
orientacionFloat =[]
oy = []
oz =[]
alt = []
cont = 0
def validateData(i):
try:
value = re.split('=',i)
values = float(value[1])
except Valu... | true | true |
f7457617ca01442e8d82a9e28e33847447459e45 | 1,539 | py | Python | lungSegmentation/RFunction.py | slowy07/medical-BCDU | dab1ddcacbe093b78e6830d52db2a4e6fabc3d52 | [
"MIT"
] | null | null | null | lungSegmentation/RFunction.py | slowy07/medical-BCDU | dab1ddcacbe093b78e6830d52db2a4e6fabc3d52 | [
"MIT"
] | null | null | null | lungSegmentation/RFunction.py | slowy07/medical-BCDU | dab1ddcacbe093b78e6830d52db2a4e6fabc3d52 | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
from scipy.ndimage.morphology import binary_erosion, binary_fill_holes
def hu_to_grayscale(volume):
volume = np.clip(volume, -512, 512)
mxmal = np.max(volume)
mnval = np.min(volume)
im_volume = (volume - mnval) / max(mxval - mnval, 1e-3)
im_volume ... | 29.596154 | 112 | 0.643275 | from __future__ import division
import numpy as np
from scipy.ndimage.morphology import binary_erosion, binary_fill_holes
def hu_to_grayscale(volume):
volume = np.clip(volume, -512, 512)
mxmal = np.max(volume)
mnval = np.min(volume)
im_volume = (volume - mnval) / max(mxval - mnval, 1e-3)
im_volume ... | true | true |
f74578030a64151d52de6e7ef9809a73fe1e8ba7 | 4,325 | py | Python | scripts/utils/toy_datasets.py | jlsuarezdiaz/pyDML-Stats | 495de64dbcda73ce20d8e916bf5e5077a8dae98a | [
"MIT"
] | 5 | 2018-10-30T18:05:18.000Z | 2020-10-28T17:57:33.000Z | scripts/utils/toy_datasets.py | jlsuarezdiaz/pyDML-Stats | 495de64dbcda73ce20d8e916bf5e5077a8dae98a | [
"MIT"
] | null | null | null | scripts/utils/toy_datasets.py | jlsuarezdiaz/pyDML-Stats | 495de64dbcda73ce20d8e916bf5e5077a8dae98a | [
"MIT"
] | 1 | 2019-10-16T15:56:48.000Z | 2019-10-16T15:56:48.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 26 12:25:25 2018
Toy datasets.
@author: jlsuarezdiaz
"""
import numpy as np
import pandas as pd
from six.moves import xrange
from sklearn.preprocessing import LabelEncoder
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.datasets... | 26.212121 | 168 | 0.516532 |
import numpy as np
import pandas as pd
from six.moves import xrange
from sklearn.preprocessing import LabelEncoder
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.datasets import(
load_iris, load_digits)
def toy_plot(X,y):
f, ax = plt.subplots(figsize=(12,9))
plt.axis('equal'... | true | true |
f74579158806f66c70daf8beb8cf1af1cc587f74 | 1,577 | py | Python | census_paleo/forms.py | wabarr/census-paleo | 4d05d48c719d9d4b9a039227ab4102bceb3ae887 | [
"MIT"
] | null | null | null | census_paleo/forms.py | wabarr/census-paleo | 4d05d48c719d9d4b9a039227ab4102bceb3ae887 | [
"MIT"
] | 3 | 2016-08-10T02:14:02.000Z | 2016-08-23T19:55:46.000Z | census_paleo/forms.py | wabarr/census-paleo | 4d05d48c719d9d4b9a039227ab4102bceb3ae887 | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm, Form
from census_paleo.models import occurrence, taxonomy, measured_values, specimen
from ajax_select import make_ajax_field
class OccurrenceForm(ModelForm):
taxon = make_ajax_field(occurrence, "taxon", "taxonLookup")
ref = make_ajax_field(occurren... | 39.425 | 106 | 0.745086 | from django import forms
from django.forms import ModelForm, Form
from census_paleo.models import occurrence, taxonomy, measured_values, specimen
from ajax_select import make_ajax_field
class OccurrenceForm(ModelForm):
taxon = make_ajax_field(occurrence, "taxon", "taxonLookup")
ref = make_ajax_field(occurren... | true | true |
f7457a8b059f9f8277466653a82994eeba869c28 | 57 | py | Python | tests/quantfinpy/pricing/ir/cashflow/test_schedule.py | TradingPy/quantfinpy | 20569c67314557b907dd2306dd48ec8be1b4a1a6 | [
"BSD-3-Clause"
] | 2 | 2022-03-13T12:44:17.000Z | 2022-03-31T18:00:21.000Z | tests/quantfinpy/pricing/ir/cashflow/test_schedule.py | TradingPy/quantfinpy | 20569c67314557b907dd2306dd48ec8be1b4a1a6 | [
"BSD-3-Clause"
] | null | null | null | tests/quantfinpy/pricing/ir/cashflow/test_schedule.py | TradingPy/quantfinpy | 20569c67314557b907dd2306dd48ec8be1b4a1a6 | [
"BSD-3-Clause"
] | null | null | null | """Test cases for the pricing of scheduled cashflows."""
| 28.5 | 56 | 0.736842 | true | true | |
f7457bda10287c1c64239c9802aa4e6293ce12bf | 15,413 | py | Python | canalystii/device.py | projectgus/python-canalystii | 7ef3a4a369a88976291ea91f93ef2b8c322855b9 | [
"BSD-3-Clause"
] | 3 | 2021-09-09T16:30:20.000Z | 2022-03-11T10:29:19.000Z | canalystii/device.py | projectgus/python-canalystii | 7ef3a4a369a88976291ea91f93ef2b8c322855b9 | [
"BSD-3-Clause"
] | null | null | null | canalystii/device.py | projectgus/python-canalystii | 7ef3a4a369a88976291ea91f93ef2b8c322855b9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021 Angus Gratton
#
# SPDX-License-Identifier: Apache-2.0
#
# This module contains device-level interface to Canalyst-II
import ctypes
import logging
import usb.core
import time
from . import protocol
logger = logging.getLogger(__name__)
# "Fast" lookups to go from channel to USB endpoint number
CHA... | 44.417867 | 114 | 0.635957 |
import ctypes
import logging
import usb.core
import time
from . import protocol
logger = logging.getLogger(__name__)
CHANNEL_TO_COMMAND_EP = [2, 4]
CHANNEL_TO_MESSAGE_EP = [1, 3]
class CanalystDevice(object):
COMMAND_MESSAGE_STATUS = protocol.SimpleCommand(protocol.COMMAND_MESSAGE_STATUS)
... | true | true |
f7457ed7b6ff29bd798494ae4d888deb1cb69089 | 2,602 | py | Python | common/metrics/basic_metrics.py | Ayushk4/tsat | 07f9535157e45c4b27dae7d73d199fef7fb9d37a | [
"MIT"
] | null | null | null | common/metrics/basic_metrics.py | Ayushk4/tsat | 07f9535157e45c4b27dae7d73d199fef7fb9d37a | [
"MIT"
] | null | null | null | common/metrics/basic_metrics.py | Ayushk4/tsat | 07f9535157e45c4b27dae7d73d199fef7fb9d37a | [
"MIT"
] | null | null | null | #----------------------------------------
#--------- Torch Related Imports --------
#----------------------------------------
import torch
import torch.distributed as distributed
#----------------------------------------
#--------- Import Wandb Here ------------
#----------------------------------------
import wandb
... | 28.593407 | 116 | 0.599154 |
import torch
import torch.distributed as distributed
import wandb
class TrainAccuracyMetric():
def __init__(self, initial_value, allreduce=False, **kwargs):
self.current_value = initial_value
self.iterations = 1
self.allreduce = allreduce
def update(self, new_value):
... | true | true |
f7457ee1ff76645e069223188fb9dd3a27d7001c | 3,821 | py | Python | losses/loss_factory.py | iimmortall/QuantLib | 29e83dad8738d0fb4efb18d0cb5dd3a7029abd86 | [
"MIT"
] | null | null | null | losses/loss_factory.py | iimmortall/QuantLib | 29e83dad8738d0fb4efb18d0cb5dd3a7029abd86 | [
"MIT"
] | null | null | null | losses/loss_factory.py | iimmortall/QuantLib | 29e83dad8738d0fb4efb18d0cb5dd3a7029abd86 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
def cross_entropy_dist_epoch(reduction='mean', **_):
cross_entropy_fn = torch.nn.CrossEntropyLoss(reduction=reduction)
l1_fn = torch.nn.L1Loss(reduction=reduction)
def loss_fn(output... | 33.517544 | 99 | 0.645904 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
def cross_entropy_dist_epoch(reduction='mean', **_):
cross_entropy_fn = torch.nn.CrossEntropyLoss(reduction=reduction)
l1_fn = torch.nn.L1Loss(reduction=reduction)
def loss_fn(output... | true | true |
f7457f8e9e82eb35f126a4968c31abe16b7ae9b3 | 5,658 | py | Python | cardapioRestaurante.py | manot13/Python | 5320a5e0fa3c55391387cedda03f5b79f8e165de | [
"MIT"
] | null | null | null | cardapioRestaurante.py | manot13/Python | 5320a5e0fa3c55391387cedda03f5b79f8e165de | [
"MIT"
] | null | null | null | cardapioRestaurante.py | manot13/Python | 5320a5e0fa3c55391387cedda03f5b79f8e165de | [
"MIT"
] | null | null | null | def escreverPratos():
for i in range(0, t):
op = int(input("\nEscolha o prato de sua preferência: "))
if op == 1:
vet.append("Bobó de Camarão")
vetPrecoPrato.append(25.90)
if op == 2:
vet.append("Moqueca de Camarão")
vetPrecoPrato.append(29.90)... | 36.269231 | 116 | 0.557264 | def escreverPratos():
for i in range(0, t):
op = int(input("\nEscolha o prato de sua preferência: "))
if op == 1:
vet.append("Bobó de Camarão")
vetPrecoPrato.append(25.90)
if op == 2:
vet.append("Moqueca de Camarão")
vetPrecoPrato.append(29.90)... | true | true |
f7457fb7b4395380211e35c921dae707a03de2f2 | 5,081 | py | Python | tests/build/_internal/config/test_source.py | hugueskamba/mbed-tools | 05e3c5ade94f504240edff6a8e3d01a72c0fd7e6 | [
"Apache-2.0"
] | null | null | null | tests/build/_internal/config/test_source.py | hugueskamba/mbed-tools | 05e3c5ade94f504240edff6a8e3d01a72c0fd7e6 | [
"Apache-2.0"
] | null | null | null | tests/build/_internal/config/test_source.py | hugueskamba/mbed-tools | 05e3c5ade94f504240edff6a8e3d01a72c0fd7e6 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2020 Arm Mbed. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
import json
import pathlib
import tempfile
from unittest import TestCase
from mbed_tools.build._internal.config.source import (
Source,
_namespace_data,
_filter_target_overrides,
_decode_json_file,
)
class T... | 35.531469 | 108 | 0.512498 |
import json
import pathlib
import tempfile
from unittest import TestCase
from mbed_tools.build._internal.config.source import (
Source,
_namespace_data,
_filter_target_overrides,
_decode_json_file,
)
class TestSource(TestCase):
def test_from_mbed_lib(self):
with tempfile.TemporaryDire... | true | true |
f7458083858d62d0b01231f726ea52502ce08653 | 219 | py | Python | 3342.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 3342.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 3342.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | n = int(input())
brancas = pretas = 0
if n % 2 == 0:
brancas = pretas = n * n / 2
else:
brancas = int(n * n / 2) + 1
pretas = brancas - 1
print(f"{brancas:.0f} casas brancas e {pretas:.0f} casas pretas") | 19.909091 | 65 | 0.561644 | n = int(input())
brancas = pretas = 0
if n % 2 == 0:
brancas = pretas = n * n / 2
else:
brancas = int(n * n / 2) + 1
pretas = brancas - 1
print(f"{brancas:.0f} casas brancas e {pretas:.0f} casas pretas") | true | true |
f74581304b1ec7afe6efed1c1a84fed53c39ec0a | 3,460 | py | Python | app/celery/process_ses_receipts_tasks.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | app/celery/process_ses_receipts_tasks.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | app/celery/process_ses_receipts_tasks.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import iso8601
from celery.exceptions import Retry
from flask import current_app, json
from notifications_utils.statsd_decorators import statsd
from sqlalchemy.orm.exc import NoResultFound
from app import notify_celery, statsd_client
from app.clients.email.aws_ses import get_a... | 39.770115 | 120 | 0.697399 | from datetime import datetime, timedelta
import iso8601
from celery.exceptions import Retry
from flask import current_app, json
from notifications_utils.statsd_decorators import statsd
from sqlalchemy.orm.exc import NoResultFound
from app import notify_celery, statsd_client
from app.clients.email.aws_ses import get_a... | true | true |
f74581da50ae282d849bc8e1f311118ba32066af | 1,767 | py | Python | utility.py | DFrye333/DynamicMaze | aefc751f67c39d86a8efd747260366f86f42b5c3 | [
"MIT"
] | null | null | null | utility.py | DFrye333/DynamicMaze | aefc751f67c39d86a8efd747260366f86f42b5c3 | [
"MIT"
] | null | null | null | utility.py | DFrye333/DynamicMaze | aefc751f67c39d86a8efd747260366f86f42b5c3 | [
"MIT"
] | null | null | null | '''
Module: utility
Author: David Frye
Description: Contains a variety of helper Classes.
'''
import enum
import random
class Direction(enum.Enum):
'''
Enum: Direction
Description: Represents the four primary cardinal directions (North, East, South, and West)
'''
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
def ge... | 27.609375 | 95 | 0.744765 |
import enum
import random
class Direction(enum.Enum):
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
def get_random():
return Direction(random.randint(0, 3))
def get_opposite(direction):
return Direction((direction.value + 2) % 4)
def get_next_clockwise(direction):
return Direction((direction.value + 1) % 4... | true | true |
f745822e65bfbe7fdb714bbbf2cb96f009608efc | 1,716 | py | Python | tensorforce/core/baselines/cnn_baseline.py | philipshurpik/tensorforce | 0a30b4a4171fd279fc48a539d74dbd3153aafd9d | [
"Apache-2.0"
] | 2 | 2021-11-14T12:28:24.000Z | 2022-02-14T19:23:51.000Z | tensorforce/core/baselines/cnn_baseline.py | philipshurpik/tensorforce | 0a30b4a4171fd279fc48a539d74dbd3153aafd9d | [
"Apache-2.0"
] | null | null | null | tensorforce/core/baselines/cnn_baseline.py | philipshurpik/tensorforce | 0a30b4a4171fd279fc48a539d74dbd3153aafd9d | [
"Apache-2.0"
] | 3 | 2021-03-04T17:26:43.000Z | 2021-03-04T17:27:10.000Z | # Copyright 2017 reinforce.io. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.020408 | 102 | 0.667832 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from tensorforce.core.baselines import NetworkBaseline
class CNNBaseline(NetworkBaseline):
def __init__(self, conv_sizes, dense_sizes, scope='cnn-baseline', summary_labels=()):
ne... | true | true |
f7458245c2b01611137d23ff7826716abd4a3ebb | 21,300 | py | Python | legacy/src/EvoNN.py | Payuing/evoDNN | 79b727d5062a27d3f8e95f175c509613f52e58aa | [
"MIT"
] | null | null | null | legacy/src/EvoNN.py | Payuing/evoDNN | 79b727d5062a27d3f8e95f175c509613f52e58aa | [
"MIT"
] | null | null | null | legacy/src/EvoNN.py | Payuing/evoDNN | 79b727d5062a27d3f8e95f175c509613f52e58aa | [
"MIT"
] | null | null | null | """
A module to implement the evolutionary algorithm for
a feedforward neural network.
Crossover and mutation
"""
from __future__ import absolute_import
from __future__ import print_function
import sys
import math
import csv
import warnings
import numpy as np
import random
import copy
from datetime impo... | 42.094862 | 176 | 0.691174 | from __future__ import absolute_import
from __future__ import print_function
import sys
import math
import csv
import warnings
import numpy as np
import random
import copy
from datetime import datetime
warnings.filterwarnings("ignore")
sys.path.append("/Users/Payu/Desktop/EvoNN_package/EvoNN_DNN")
NUM_L... | true | true |
f7458296b42991a6e37b5174ddc9f7ac51ed81c7 | 764 | py | Python | ddtrace/contrib/aiopg/__init__.py | KDWSS/dd-trace-py | 6d859bec403347f7c1e7efd039210908b562741e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/contrib/aiopg/__init__.py | KDWSS/dd-trace-py | 6d859bec403347f7c1e7efd039210908b562741e | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2021-07-26T01:22:38.000Z | 2022-03-21T19:20:53.000Z | ddtrace/contrib/aiopg/__init__.py | KDWSS/dd-trace-py | 6d859bec403347f7c1e7efd039210908b562741e | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-03T12:41:49.000Z | 2021-08-03T12:41:49.000Z | """
Instrument aiopg to report a span for each executed Postgres queries::
from ddtrace import Pin, patch
import aiopg
# If not patched yet, you can patch aiopg specifically
patch(aiopg=True)
# This will report a span with the default settings
async with aiopg.connect(DSN) as db:
with... | 27.285714 | 70 | 0.693717 | from ...utils.importlib import require_modules
required_modules = ["aiopg"]
with require_modules(required_modules) as missing_modules:
if not missing_modules:
from .patch import patch
__all__ = ["patch"]
| true | true |
f74583b01fe4bd95d2d76464213f5471947781ad | 1,013 | py | Python | aoc/year2021/day13/day13.py | Godsmith/adventofcode | 3c59ea66830f82b63881e0ea19bfe3076f2a500d | [
"Unlicense"
] | null | null | null | aoc/year2021/day13/day13.py | Godsmith/adventofcode | 3c59ea66830f82b63881e0ea19bfe3076f2a500d | [
"Unlicense"
] | null | null | null | aoc/year2021/day13/day13.py | Godsmith/adventofcode | 3c59ea66830f82b63881e0ea19bfe3076f2a500d | [
"Unlicense"
] | null | null | null | from dataclasses import dataclass
from functools import reduce
from parse import findall
from aocd import get_data
@dataclass
class Fold:
x_or_y: str
value: int
def fold(self, coordinates):
return {self._transform(x, y) for x, y in coordinates}
def _transform(self, x, y):
if self.x_... | 28.942857 | 86 | 0.6308 | from dataclasses import dataclass
from functools import reduce
from parse import findall
from aocd import get_data
@dataclass
class Fold:
x_or_y: str
value: int
def fold(self, coordinates):
return {self._transform(x, y) for x, y in coordinates}
def _transform(self, x, y):
if self.x_... | true | true |
f74584c44862caea53bd0ca8644859935ed5c5a8 | 4,445 | py | Python | ezeeai/core/explainer.py | jmarine/ezeeai | 091b4ce3bc5794c534084bff3301b15ba8a9be1a | [
"Apache-2.0"
] | 19 | 2019-06-12T03:14:59.000Z | 2021-05-31T16:02:53.000Z | ezeeai/core/explainer.py | jmarine/ezeeai | 091b4ce3bc5794c534084bff3301b15ba8a9be1a | [
"Apache-2.0"
] | 29 | 2019-06-27T10:15:38.000Z | 2022-03-11T23:46:36.000Z | ezeeai/core/explainer.py | jmarine/ezeeai | 091b4ce3bc5794c534084bff3301b15ba8a9be1a | [
"Apache-2.0"
] | 10 | 2019-05-14T17:45:44.000Z | 2020-08-26T13:25:04.000Z | from lime import lime_tabular, lime_image
from scipy.misc import imresize
import numpy as np
import tensorflow as tf
class TabularExplainer:
def __init__(self, dataset, verbose=True):
train_dataset, training_labels = dataset.make_numpy_array(dataset.get_train_file())
mode = dataset.get_mode()
... | 47.795699 | 112 | 0.575253 | from lime import lime_tabular, lime_image
from scipy.misc import imresize
import numpy as np
import tensorflow as tf
class TabularExplainer:
def __init__(self, dataset, verbose=True):
train_dataset, training_labels = dataset.make_numpy_array(dataset.get_train_file())
mode = dataset.get_mode()
... | true | true |
f7458534f701392c1a444446f2da12e4651274fd | 4,348 | py | Python | composer/models/resnets.py | murthyn/composer | 2a04cf387dd8558556500f7ef2bc6d3d131043d5 | [
"Apache-2.0"
] | null | null | null | composer/models/resnets.py | murthyn/composer | 2a04cf387dd8558556500f7ef2bc6d3d131043d5 | [
"Apache-2.0"
] | null | null | null | composer/models/resnets.py | murthyn/composer | 2a04cf387dd8558556500f7ef2bc6d3d131043d5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
"""The CIFAR ResNet torch module.
See the :doc:`Model Card </model_cards/resnet>` for more details.
"""
# Code below adapted from https://github.com/facebookresearch/open_lth
# and https://github.com/pytorch/vision
from typing import List, Tuple
import torch
import t... | 35.639344 | 104 | 0.608326 |
from typing import List, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from composer.models import Initializer
__all__ = ["CIFAR_ResNet"]
class CIFAR_ResNet(nn.Module):
class Block(nn.Module):
def __init__(self, f_in: int, f_out: int, downsample: bool = False):
... | true | true |
f74585554fdf06104b6776fbdf41a0b17bc71777 | 7,817 | py | Python | src/bindings/python/tests/test_ngraph/test_core.py | evgeniya-egupova/openvino | 4b8d6c59e3444ecdc549bfdf357d19d625479b89 | [
"Apache-2.0"
] | null | null | null | src/bindings/python/tests/test_ngraph/test_core.py | evgeniya-egupova/openvino | 4b8d6c59e3444ecdc549bfdf357d19d625479b89 | [
"Apache-2.0"
] | 44 | 2020-11-18T10:49:27.000Z | 2022-03-28T13:18:44.000Z | src/bindings/python/tests/test_ngraph/test_core.py | rkazants/openvino | a9a583eb42d43322b39b95b164b5b22c4f341111 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import openvino.runtime.opset8 as ov
from openvino.runtime.impl import Dimension, Function, PartialShape, Shape
def test_dimension():
dim = Dimension()
assert dim.is_dynamic
assert not dim.is_static
... | 29.722433 | 86 | 0.643469 |
import numpy as np
import openvino.runtime.opset8 as ov
from openvino.runtime.impl import Dimension, Function, PartialShape, Shape
def test_dimension():
dim = Dimension()
assert dim.is_dynamic
assert not dim.is_static
assert repr(dim) == "<Dimension: ?>"
dim = Dimension.dynamic()
assert d... | true | true |
f74586a9a2e957cdc6a027edd7f741dc21f08c31 | 95 | py | Python | helli5/contextprocessor.py | TheMn/internet-engineering-project | e41536552feff6f806ba099922df95e89da5bd31 | [
"Apache-2.0"
] | 7 | 2019-10-19T12:58:11.000Z | 2020-11-05T07:02:17.000Z | helli5/contextprocessor.py | TheMn/internet-engineering-project | e41536552feff6f806ba099922df95e89da5bd31 | [
"Apache-2.0"
] | 35 | 2019-12-06T16:31:07.000Z | 2022-03-12T00:56:35.000Z | helli5/contextprocessor.py | TheMn/internet-engineering-project | e41536552feff6f806ba099922df95e89da5bd31 | [
"Apache-2.0"
] | 1 | 2019-10-18T19:07:04.000Z | 2019-10-18T19:07:04.000Z | from datetime import datetime
def time_now(request):
return {'time_now': datetime.now()}
| 15.833333 | 39 | 0.726316 | from datetime import datetime
def time_now(request):
return {'time_now': datetime.now()}
| true | true |
f74586b65340aa36380793a1f23bd094d287cf09 | 64 | py | Python | src/greenbudget/app/fringe/__init__.py | nickmflorin/django-proper-architecture-testing | da7c4019697e85f921695144375d2f548f1e98ad | [
"MIT"
] | null | null | null | src/greenbudget/app/fringe/__init__.py | nickmflorin/django-proper-architecture-testing | da7c4019697e85f921695144375d2f548f1e98ad | [
"MIT"
] | null | null | null | src/greenbudget/app/fringe/__init__.py | nickmflorin/django-proper-architecture-testing | da7c4019697e85f921695144375d2f548f1e98ad | [
"MIT"
] | null | null | null | default_app_config = 'greenbudget.app.fringe.apps.FringeConfig'
| 32 | 63 | 0.84375 | default_app_config = 'greenbudget.app.fringe.apps.FringeConfig'
| true | true |
f74586fec08c6cb18fc3718d999cf795bfc6bd41 | 4,015 | py | Python | control/base.py | majkee15/HiddenMarkovJumpProcess-RLEnvironment | 730ef636bfa51f6137268ab7760f9a504ba583db | [
"MIT"
] | null | null | null | control/base.py | majkee15/HiddenMarkovJumpProcess-RLEnvironment | 730ef636bfa51f6137268ab7760f9a504ba583db | [
"MIT"
] | null | null | null | control/base.py | majkee15/HiddenMarkovJumpProcess-RLEnvironment | 730ef636bfa51f6137268ab7760f9a504ba583db | [
"MIT"
] | null | null | null | import os
import logging
import datetime
import numpy as np
import tensorflow as tf
from gym.spaces import Box, Discrete
from gym.utils import colorize
from control.utils.misc import Config
from control.utils.misc import REPO_ROOT, RESOURCE_ROOT
from abc import ABC, abstractmethod
class TrainConfigBase(Config):... | 27.128378 | 115 | 0.625156 | import os
import logging
import datetime
import numpy as np
import tensorflow as tf
from gym.spaces import Box, Discrete
from gym.utils import colorize
from control.utils.misc import Config
from control.utils.misc import REPO_ROOT, RESOURCE_ROOT
from abc import ABC, abstractmethod
class TrainConfigBase(Config):... | true | true |
f74587955cf3c7c946f58e91763dcf1423875e36 | 13,578 | py | Python | test/test_ops_jit.py | tenpercent/pytorch | 7f996b855c5070ab4a6bea0f451c8a22c0ce2394 | [
"Intel"
] | 1 | 2022-03-29T00:44:31.000Z | 2022-03-29T00:44:31.000Z | test/test_ops_jit.py | tenpercent/pytorch | 7f996b855c5070ab4a6bea0f451c8a22c0ce2394 | [
"Intel"
] | null | null | null | test/test_ops_jit.py | tenpercent/pytorch | 7f996b855c5070ab4a6bea0f451c8a22c0ce2394 | [
"Intel"
] | 1 | 2022-03-28T21:49:41.000Z | 2022-03-28T21:49:41.000Z | # Owner(s): ["module: unknown"]
from functools import partial
import torch
from torch.testing import FileCheck
from torch.testing._internal.common_utils import \
(run_tests, IS_SANDCASTLE, clone_input_helper, first_sample)
from torch.testing._internal.common_methods_invocations import op_db
from torch.testing._i... | 48.320285 | 132 | 0.560024 |
from functools import partial
import torch
from torch.testing import FileCheck
from torch.testing._internal.common_utils import \
(run_tests, IS_SANDCASTLE, clone_input_helper, first_sample)
from torch.testing._internal.common_methods_invocations import op_db
from torch.testing._internal.common_device_type impo... | true | true |
f74587ad72d7181d0a60eca882d2765db3f99b2d | 1,201 | py | Python | src/DocClustering/data/document.py | jd-s/DocClustering | a7d4acff8464f960558cf9cc6d03de78d07d56bf | [
"Apache-2.0"
] | null | null | null | src/DocClustering/data/document.py | jd-s/DocClustering | a7d4acff8464f960558cf9cc6d03de78d07d56bf | [
"Apache-2.0"
] | null | null | null | src/DocClustering/data/document.py | jd-s/DocClustering | a7d4acff8464f960558cf9cc6d03de78d07d56bf | [
"Apache-2.0"
] | null | null | null | # Helper class that stores all relevant information of a document
class document:
def __init__(self, id, externalid=0, title="", author="", publishingYear=0, journal="", terms=[], uri="" ):
self.id = id
self.externalid = externalid
self.title = title
self.author = author
sel... | 26.688889 | 111 | 0.605329 |
class document:
def __init__(self, id, externalid=0, title="", author="", publishingYear=0, journal="", terms=[], uri="" ):
self.id = id
self.externalid = externalid
self.title = title
self.author = author
self.publishingYear = str(publishingYear).strip()
self.journ... | true | true |
f745882b7fa076b31cfecf66c9b6f8b109221cd1 | 1,962 | py | Python | download_all_fx_data.py | feilongbk/FX-1-Minute-Data | 83bd7eaef0dee7221e8acfa980ce180571b6ffce | [
"Apache-2.0"
] | 326 | 2017-05-22T07:03:36.000Z | 2022-03-31T21:57:21.000Z | download_all_fx_data.py | feilongbk/FX-1-Minute-Data | 83bd7eaef0dee7221e8acfa980ce180571b6ffce | [
"Apache-2.0"
] | 9 | 2017-12-15T10:30:17.000Z | 2021-06-10T01:07:34.000Z | download_all_fx_data.py | feilongbk/FX-1-Minute-Data | 83bd7eaef0dee7221e8acfa980ce180571b6ffce | [
"Apache-2.0"
] | 140 | 2017-08-07T17:20:48.000Z | 2022-03-29T19:46:23.000Z | import csv
import os
from histdata.api import download_hist_data
def mkdir_p(path):
import errno
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def download_all():
with open('pairs.... | 36.333333 | 85 | 0.445464 | import csv
import os
from histdata.api import download_hist_data
def mkdir_p(path):
import errno
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def download_all():
with open('pairs.... | true | true |
f745897e4c8d34c7039d8c180efdb79da56c845d | 232 | py | Python | rest_framework_simplejwt/__init__.py | Alig1493/django-rest-framework-simplejwt | aaebe1aa453da392dff44690760b50cd2a10c6d1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | rest_framework_simplejwt/__init__.py | Alig1493/django-rest-framework-simplejwt | aaebe1aa453da392dff44690760b50cd2a10c6d1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | rest_framework_simplejwt/__init__.py | Alig1493/django-rest-framework-simplejwt | aaebe1aa453da392dff44690760b50cd2a10c6d1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("django-rest-framework-simplejwt").version
except DistributionNotFound:
# package is not installed
__version__ = None
| 29 | 77 | 0.801724 | from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("django-rest-framework-simplejwt").version
except DistributionNotFound:
__version__ = None
| true | true |
f74589a41c15eec76623b27d04ad44dff7a510ed | 630 | py | Python | src/manage.py | AVRC26/blog-ui | fbecbf6f20f3df3da525e9c7963269cd5f4e8e65 | [
"Apache-2.0"
] | null | null | null | src/manage.py | AVRC26/blog-ui | fbecbf6f20f3df3da525e9c7963269cd5f4e8e65 | [
"Apache-2.0"
] | null | null | null | src/manage.py | AVRC26/blog-ui | fbecbf6f20f3df3da525e9c7963269cd5f4e8e65 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lllorigins.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Imp... | 28.636364 | 74 | 0.684127 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lllorigins.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f7458a0fd5b4b626e4e84f3de4fa62431c2a0cf6 | 1,731 | py | Python | Client-Python/client.py | iao113/transfer | 45dcfbe3f5d98bc9fba873f005c6774ce5b53a68 | [
"Apache-2.0"
] | null | null | null | Client-Python/client.py | iao113/transfer | 45dcfbe3f5d98bc9fba873f005c6774ce5b53a68 | [
"Apache-2.0"
] | null | null | null | Client-Python/client.py | iao113/transfer | 45dcfbe3f5d98bc9fba873f005c6774ce5b53a68 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import socket
from collections import namedtuple
from enum import Enum, unique
HeadTerm = namedtuple('HeadTerm', ['index', 'value'])
@unique
class Header(Enum):
FILE_NAME = HeadTerm(index=0, value=0x80)
FILE_SIZE = HeadTerm(index=0, value=0x40)
FILE_CONTEXT = HeadTerm(in... | 29.844828 | 105 | 0.650491 |
import os
import socket
from collections import namedtuple
from enum import Enum, unique
HeadTerm = namedtuple('HeadTerm', ['index', 'value'])
@unique
class Header(Enum):
FILE_NAME = HeadTerm(index=0, value=0x80)
FILE_SIZE = HeadTerm(index=0, value=0x40)
FILE_CONTEXT = HeadTerm(index=0, value=0x20)
de... | true | true |
f7458ac7dade2736ba8d98e756a586fa9ab182a0 | 4,381 | py | Python | test/functional/p2p_invalid_block.py | brewhaus2/Placeholders-X16R | 8757eef1a0596df490be28a0f259ab26597ac851 | [
"MIT"
] | 23 | 2018-12-18T16:46:37.000Z | 2022-01-03T23:11:09.000Z | test/functional/p2p_invalid_block.py | brewhaus2/Placeholders-X16R | 8757eef1a0596df490be28a0f259ab26597ac851 | [
"MIT"
] | 1 | 2018-12-15T19:08:42.000Z | 2018-12-15T19:09:35.000Z | test/functional/p2p_invalid_block.py | brewhaus2/Placeholders-X16R | 8757eef1a0596df490be28a0f259ab26597ac851 | [
"MIT"
] | 11 | 2018-12-12T05:45:24.000Z | 2021-04-23T03:07:21.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Placeholder Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid blocks.
In th... | 37.127119 | 100 | 0.656928 |
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, TestInstance, RejectResult
from test_framework.blocktools import *
import copy
import time
class InvalidBlockRequestTest(ComparisonTestFramework):
def set_tes... | true | true |
f7458b00348cac441eb8387b8d6c77968cbe34a2 | 2,474 | py | Python | Spyder/Ejercicios/Comparacion medias.py | AlexPC23/Python | 77689d74c5444faa1aa253a122602307e52ac581 | [
"Apache-2.0"
] | null | null | null | Spyder/Ejercicios/Comparacion medias.py | AlexPC23/Python | 77689d74c5444faa1aa253a122602307e52ac581 | [
"Apache-2.0"
] | null | null | null | Spyder/Ejercicios/Comparacion medias.py | AlexPC23/Python | 77689d74c5444faa1aa253a122602307e52ac581 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 6 19:54:52 2021
@author: Alex
"""
import os #sistema operativo
import pandas as pd #gestionar datframes
import numpy as np #numeric python (vectores, matrices,...)
import matplotlib.py... | 34.84507 | 101 | 0.671382 |
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import seaborn as sns
os.chdir('C:/Programacion Estadistica PEP... | true | true |
f7458bcb1e64294e6ca55970c086596d20e0fedc | 1,272 | py | Python | day04/d04.py | jcisio/adventofcode2021 | 280e88b636e07772b3793b88d3298586661166e6 | [
"MIT"
] | null | null | null | day04/d04.py | jcisio/adventofcode2021 | 280e88b636e07772b3793b88d3298586661166e6 | [
"MIT"
] | null | null | null | day04/d04.py | jcisio/adventofcode2021 | 280e88b636e07772b3793b88d3298586661166e6 | [
"MIT"
] | null | null | null | f = open('d04.in', 'r')
def calculateScore(card, number):
for i in range(5):
if sum(card[i::5]) == -5 or sum(card[i*5:i*5+5]) == -5:
return sum([x for x in card if x != -1]) * number
return -1
def calculateFinalScore(cards, number):
for card in cards:
score = calculateScore(ca... | 31.8 | 92 | 0.587264 | f = open('d04.in', 'r')
def calculateScore(card, number):
for i in range(5):
if sum(card[i::5]) == -5 or sum(card[i*5:i*5+5]) == -5:
return sum([x for x in card if x != -1]) * number
return -1
def calculateFinalScore(cards, number):
for card in cards:
score = calculateScore(ca... | true | true |
f7458c3036734e4bb6e554097029270e11912a3a | 4,528 | py | Python | deploy/pdserving/ocr_local_server.py | happog/PaddleOCR | 597bd9bf7e160e525dadaa3e519379ec9cc69669 | [
"Apache-2.0"
] | 21 | 2020-12-01T14:00:40.000Z | 2022-03-29T03:26:10.000Z | deploy/pdserving/ocr_local_server.py | wangxinxin08/PaddleOCR | 5ed1e2427b4e1759f0e9278f453e8d497db33b59 | [
"Apache-2.0"
] | 3 | 2021-04-28T09:22:27.000Z | 2022-01-05T11:16:40.000Z | deploy/pdserving/ocr_local_server.py | wangxinxin08/PaddleOCR | 5ed1e2427b4e1759f0e9278f453e8d497db33b59 | [
"Apache-2.0"
] | 4 | 2021-02-26T08:53:16.000Z | 2021-12-11T08:17:48.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 39.719298 | 97 | 0.651943 |
from paddle_serving_client import Client
from paddle_serving_app.reader import OCRReader
import cv2
import sys
import numpy as np
import os
from paddle_serving_client import Client
from paddle_serving_app.reader import Sequential, URL2Image, ResizeByFactor
from paddle_serving_app.reader import Div, Normal... | true | true |
f7458c30cc2fa802624a2a70a9422c6c7e9ff1a0 | 351 | py | Python | BioNetGen-2.3.0/source_Atomizer/stats/wordcloud.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | BioNetGen-2.3.0/source_Atomizer/stats/wordcloud.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | BioNetGen-2.3.0/source_Atomizer/stats/wordcloud.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 27 18:06:08 2013
@author: proto
"""
from pytagcloud import create_tag_image, make_tags
from pytagcloud.lang.counter import get_tag_counts
def cloudText(text,fileName):
tags = make_tags(get_tag_counts(text), maxsize=80)
create_tag_image(tags, fileName, size=(800,... | 23.4 | 76 | 0.732194 |
from pytagcloud import create_tag_image, make_tags
from pytagcloud.lang.counter import get_tag_counts
def cloudText(text,fileName):
tags = make_tags(get_tag_counts(text), maxsize=80)
create_tag_image(tags, fileName, size=(800, 600), fontname='Droid Sans')
| true | true |
f7458c85eb2099a8ad9fec140d062dfd10309958 | 19,258 | py | Python | sdk/python/pulumi_aws/glue/get_script.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | 260 | 2018-06-18T14:57:00.000Z | 2022-03-29T11:41:03.000Z | sdk/python/pulumi_aws/glue/get_script.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | 1,154 | 2018-06-19T20:38:20.000Z | 2022-03-31T19:48:16.000Z | sdk/python/pulumi_aws/glue/get_script.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | 115 | 2018-06-28T03:20:27.000Z | 2022-03-29T11:41:06.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 37.613281 | 146 | 0.500571 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = [
'GetScriptResult',
'AwaitableGetScriptResult',
'get_script',
'get_script_output',
]
@pulumi.ou... | true | true |
f7458d3d9c43dbaff12d196fdd13b750ee11b4ef | 2,357 | py | Python | Assignment 0/Part 2 - Getting Familiar with Python/SettingPixels.py | PMARINA/COS-429 | 25134e77101279c3f9f16a6738beb6170ba1fd09 | [
"MIT"
] | null | null | null | Assignment 0/Part 2 - Getting Familiar with Python/SettingPixels.py | PMARINA/COS-429 | 25134e77101279c3f9f16a6738beb6170ba1fd09 | [
"MIT"
] | null | null | null | Assignment 0/Part 2 - Getting Familiar with Python/SettingPixels.py | PMARINA/COS-429 | 25134e77101279c3f9f16a6738beb6170ba1fd09 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import os
window_title = "The Input Image"
input_image = "input.jpg"
output_image = os.path.basename(__file__)[:-len(".py")] + ".jpg"
HORIZONTAL = 0
VERTICAL = 1
def read_image(file_name = input_image):
img = cv2.imread(file_name)
return img
def display_image(img,window_title = w... | 34.15942 | 131 | 0.694103 | import numpy as np
import cv2
import os
window_title = "The Input Image"
input_image = "input.jpg"
output_image = os.path.basename(__file__)[:-len(".py")] + ".jpg"
HORIZONTAL = 0
VERTICAL = 1
def read_image(file_name = input_image):
img = cv2.imread(file_name)
return img
def display_image(img,window_title = w... | true | true |
f7458deb730a807b3c7db235ac0eea38dbbc1b53 | 185 | py | Python | CursoEmVideo/107Cev/moeda.py | yazdejesus/FirstLessons-Python | e2c2d75c3aba459669c972a3c959b18ecc82e030 | [
"MIT"
] | null | null | null | CursoEmVideo/107Cev/moeda.py | yazdejesus/FirstLessons-Python | e2c2d75c3aba459669c972a3c959b18ecc82e030 | [
"MIT"
] | 1 | 2021-01-28T17:06:06.000Z | 2021-01-30T15:13:03.000Z | CursoEmVideo/107Cev/moeda.py | yazdejesus/FirstLessons-Python | e2c2d75c3aba459669c972a3c959b18ecc82e030 | [
"MIT"
] | null | null | null | def metade(num):
return num/2
def dobro(num):
return num*2
def aumentar(num, perc):
perc /= 100
return num + num*perc
def diminuir(num, perc):
perc /= 100
return num - num*perc | 14.230769 | 24 | 0.675676 | def metade(num):
return num/2
def dobro(num):
return num*2
def aumentar(num, perc):
perc /= 100
return num + num*perc
def diminuir(num, perc):
perc /= 100
return num - num*perc | true | true |
f7458e0bb7ab25751a418de308df0b366f9dce88 | 9,777 | py | Python | tests/test_0017-multi-basket-multi-branch-fetch.py | raymondEhlers/uproot4 | b266614eb3e24d02fa5ed2be4a2d95ab71a5e499 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0017-multi-basket-multi-branch-fetch.py | raymondEhlers/uproot4 | b266614eb3e24d02fa5ed2be4a2d95ab71a5e499 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0017-multi-basket-multi-branch-fetch.py | raymondEhlers/uproot4 | b266614eb3e24d02fa5ed2be4a2d95ab71a5e499 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE
from __future__ import absolute_import
import sys
import json
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import numpy
import pytest
import skhep_testdata
import uproot4
import uproot4.i... | 25.933687 | 96 | 0.495551 |
from __future__ import absolute_import
import sys
import json
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import numpy
import pytest
import skhep_testdata
import uproot4
import uproot4.interpretation.numerical
import uproot4.interpretation.library
import uproot4.source.f... | true | true |
f7458ed2d11532a6e2b9d851aa289d26ee6e21f0 | 761 | py | Python | newcode/tests/test_helper.py | rchatterjee/nocrack | 16523cb3f316a2a4ed147fe23f942b485d27d605 | [
"MIT"
] | 21 | 2015-05-12T17:38:07.000Z | 2021-01-10T19:54:55.000Z | newcode/tests/test_helper.py | rchatterjee/nocrack | 16523cb3f316a2a4ed147fe23f942b485d27d605 | [
"MIT"
] | 7 | 2015-08-27T10:57:40.000Z | 2020-04-18T08:36:42.000Z | newcode/tests/test_helper.py | rchatterjee/nocrack | 16523cb3f316a2a4ed147fe23f942b485d27d605 | [
"MIT"
] | 14 | 2015-08-27T10:53:37.000Z | 2022-03-24T15:48:47.000Z | import os
import sys
BASE_DIR = os.getcwd()
sys.path.append(BASE_DIR)
from helper import random, diff
import unittest
class TestHelper(unittest.TestCase):
def test_random(self):
for l in [1, 2, 5, 10, 100]:
a = random.randints(0, 1, l)
self.assertEqual(len(a), l, "Not returning co... | 26.241379 | 87 | 0.534823 | import os
import sys
BASE_DIR = os.getcwd()
sys.path.append(BASE_DIR)
from helper import random, diff
import unittest
class TestHelper(unittest.TestCase):
def test_random(self):
for l in [1, 2, 5, 10, 100]:
a = random.randints(0, 1, l)
self.assertEqual(len(a), l, "Not returning co... | true | true |
f74590161ee576b5d83826f1907fa3519d782343 | 2,144 | py | Python | tests/models/symbol/scsi_alias_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/symbol/scsi_alias_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/symbol/scsi_alias_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 56.421053 | 845 | 0.76959 |
import unittest
from netapp.santricity.models.symbol.scsi_alias import ScsiAlias
class ScsiAliasTest(unittest.TestCase):
def test_scsi_alias(self):
scsi_alias_obj = ScsiAlias()
self.assertNotEqual(scsi_alias_obj, None)
| true | true |
f745903ecbb955908d5bdc22ef154bdb36c285eb | 173 | py | Python | configs/cascade_rcnn/ranksort_cascade_rcnn_r50_fpn_1x_coco_lr0009_rpnw06.py | yinchimaoliang/ranksortloss | d2103598448633a108dbda4143ab8c9c3fd515f8 | [
"Apache-2.0"
] | 210 | 2021-07-27T01:30:05.000Z | 2022-03-29T07:52:35.000Z | configs/cascade_rcnn/ranksort_cascade_rcnn_r50_fpn_1x_coco_lr0009_rpnw06.py | yinchimaoliang/ranksortloss | d2103598448633a108dbda4143ab8c9c3fd515f8 | [
"Apache-2.0"
] | 12 | 2021-07-31T06:36:36.000Z | 2022-01-04T01:51:29.000Z | configs/cascade_rcnn/ranksort_cascade_rcnn_r50_fpn_1x_coco_lr0009_rpnw06.py | yinchimaoliang/ranksortloss | d2103598448633a108dbda4143ab8c9c3fd515f8 | [
"Apache-2.0"
] | 23 | 2021-07-28T01:30:33.000Z | 2022-03-03T11:18:56.000Z | _base_ = 'ranksort_cascade_rcnn_r50_fpn_1x_coco.py'
model = dict(rpn_head=dict(head_weight=0.60))
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) | 34.6 | 73 | 0.768786 | _base_ = 'ranksort_cascade_rcnn_r50_fpn_1x_coco.py'
model = dict(rpn_head=dict(head_weight=0.60))
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) | true | true |
f745911e5c38348d5697148e7bcc378ceda7c744 | 3,362 | py | Python | facemask.py | sakshamji/FacemaskDetection | b274285ebaef51c110fab3dc608a2c2ef956ec95 | [
"MIT"
] | null | null | null | facemask.py | sakshamji/FacemaskDetection | b274285ebaef51c110fab3dc608a2c2ef956ec95 | [
"MIT"
] | null | null | null | facemask.py | sakshamji/FacemaskDetection | b274285ebaef51c110fab3dc608a2c2ef956ec95 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 22 15:56:47 2020
@author: Saksham
"""
import numpy as np
import keras
import keras.backend as k
from keras.layers import Conv2D,MaxPooling2D,SpatialDropout2D,Flatten,Dropout,Dense
from keras.models import Sequential,load_model
from keras.optimizers import adam
from kera... | 30.017857 | 143 | 0.692742 |
import numpy as np
import keras
import keras.backend as k
from keras.layers import Conv2D,MaxPooling2D,SpatialDropout2D,Flatten,Dropout,Dense
from keras.models import Sequential,load_model
from keras.optimizers import adam
from keras.preprocessing import image
import cv2
import datetime
model=Sequential()
mode... | true | true |
f745919fcceab783528c441f6f8a6043f6ba7750 | 678 | py | Python | test_is_valid_binary_search_tree.py | kannanParamasivam/practice | f8f476ba5b97dfbe0b673a200c1668dcd9370b04 | [
"Apache-2.0"
] | null | null | null | test_is_valid_binary_search_tree.py | kannanParamasivam/practice | f8f476ba5b97dfbe0b673a200c1668dcd9370b04 | [
"Apache-2.0"
] | null | null | null | test_is_valid_binary_search_tree.py | kannanParamasivam/practice | f8f476ba5b97dfbe0b673a200c1668dcd9370b04 | [
"Apache-2.0"
] | null | null | null | import unittest
from typing import List
from is_valid_binary_search_tree import Solution, TreeNode
class TestSolution(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_isValidBST_when_tree_has_single_node_should_return_true(self):
... | 23.37931 | 75 | 0.641593 | import unittest
from typing import List
from is_valid_binary_search_tree import Solution, TreeNode
class TestSolution(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_isValidBST_when_tree_has_single_node_should_return_true(self):
... | true | true |
f74592b6ae400e6f402dd2a85c71abf45e1df7a1 | 3,839 | py | Python | Improving the ANN.py | AjayJohnAlex/ANN | 236bc4ca4aaa07038610bc6870578b1f0255da49 | [
"MIT"
] | 1 | 2021-05-06T15:05:09.000Z | 2021-05-06T15:05:09.000Z | Improving the ANN.py | AjayJohnAlex/ANN | 236bc4ca4aaa07038610bc6870578b1f0255da49 | [
"MIT"
] | null | null | null | Improving the ANN.py | AjayJohnAlex/ANN | 236bc4ca4aaa07038610bc6870578b1f0255da49 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
get_ipython().run_line_magic('matplotlib', 'inline')
# In[2]:
dataset = pd.read_csv('Churn_Modelling.csv')
dataset.head()
# In[3]:
X = dataset.iloc[:,3:13].values
# In[4]:
y = dataset.i... | 17.773148 | 89 | 0.678823 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
get_ipython().run_line_magic('matplotlib', 'inline')
dataset = pd.read_csv('Churn_Modelling.csv')
dataset.head()
X = dataset.iloc[:,3:13].values
y = dataset.iloc[:,13].values
from sklearn.model_select... | true | true |
f74593e5c940d1e7725f5d76b2bde70af39bdf91 | 2,273 | py | Python | docs/source/conf.py | grcasanova/Reticulum | d326df6c5a467bf3af6e9ace2a020849ed3fd0be | [
"MIT"
] | null | null | null | docs/source/conf.py | grcasanova/Reticulum | d326df6c5a467bf3af6e9ace2a020849ed3fd0be | [
"MIT"
] | null | null | null | docs/source/conf.py | grcasanova/Reticulum | d326df6c5a467bf3af6e9ace2a020849ed3fd0be | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.426471 | 79 | 0.661681 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
project = 'Reticulum Network Stack'
copyright = '2021, Mark Qvist'
author = 'Mark Qvist'
release = '0.2.1 beta'
extensions = [
'sphinx.ext.autodoc',
]
autodoc_member_order = 'bysource'
templates_path = ['_templates']... | true | true |
f74594241b62311f3ce32e2350126abb5c5bc41c | 202 | py | Python | config.py | TheEdu/backups-automation | 0aaddb970e84c0327476eef8442c33c11862f2d3 | [
"MIT"
] | null | null | null | config.py | TheEdu/backups-automation | 0aaddb970e84c0327476eef8442c33c11862f2d3 | [
"MIT"
] | null | null | null | config.py | TheEdu/backups-automation | 0aaddb970e84c0327476eef8442c33c11862f2d3 | [
"MIT"
] | null | null | null | # config.py
DATABASE_CONFIG = {
'dialect': 'mysql+mysqlconnector',
'host': 'localhost',
'database': 'database',
'user': 'user',
'password': 'password',
'port': 3306
}
| 18.363636 | 39 | 0.544554 |
DATABASE_CONFIG = {
'dialect': 'mysql+mysqlconnector',
'host': 'localhost',
'database': 'database',
'user': 'user',
'password': 'password',
'port': 3306
}
| true | true |
f7459471e4cf38fb155f4a74f9eb11d22f68be73 | 10,028 | py | Python | quicksort/questions.py | Tesla-CEO/Algorithm-Design-and-Analysis | fe1e4520019f37059e9dcdb0f749be0da42caae7 | [
"MIT"
] | null | null | null | quicksort/questions.py | Tesla-CEO/Algorithm-Design-and-Analysis | fe1e4520019f37059e9dcdb0f749be0da42caae7 | [
"MIT"
] | null | null | null | quicksort/questions.py | Tesla-CEO/Algorithm-Design-and-Analysis | fe1e4520019f37059e9dcdb0f749be0da42caae7 | [
"MIT"
] | null | null | null | from typing import List, NoReturn
from random import randint
def return_rarray(_min=1, _max=10, size=5, duplicates=False) -> List[int]:
"""
Returns array of random elements [x0, x1, ..., xn]
for each element in the range (_min >= x >= _max).
Where the number of elements equals parameter -> size.
... | 43.038627 | 119 | 0.594535 | from typing import List, NoReturn
from random import randint
def return_rarray(_min=1, _max=10, size=5, duplicates=False) -> List[int]:
if (duplicates):
rv = []
for i in range(size): rv.append(randint(_min, _max))
return rv
elif not (duplicates):
if not ((m := 1 + _max - _min)... | true | true |
f745984e2d1f5c9fd82d233a67b0a78499eeae57 | 9,663 | py | Python | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/routers/flags.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/routers/flags.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/routers/flags.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 37.599222 | 80 | 0.694505 |
from googlecloudsdk.api_lib.compute import utils
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.command_lib.compute import completers as compute_completers
from googlecloudsdk.command_lib.compute import flags as compute_flags
DEFAULT_LIST_FORMAT = """\
table(
name,
re... | true | true |
f74598d7c68cd24742d1198b62b8c325ab9c24cd | 26,423 | py | Python | events/importer/espoo.py | hamk-uas/TavastiaEventsOld | b808a1418ee89ba1e774c814364e5b55ea4f9a2c | [
"MIT"
] | null | null | null | events/importer/espoo.py | hamk-uas/TavastiaEventsOld | b808a1418ee89ba1e774c814364e5b55ea4f9a2c | [
"MIT"
] | null | null | null | events/importer/espoo.py | hamk-uas/TavastiaEventsOld | b808a1418ee89ba1e774c814364e5b55ea4f9a2c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import logging
import time
from datetime import datetime, timedelta
import requests
import bleach
import dateutil.parser
import pytz
import requests_cache
from django.utils.html import strip_tags
from events.models import (
DataSource,
Event,
Keyword,
Place
)
from dja... | 38.073487 | 119 | 0.596412 |
import re
import logging
import time
from datetime import datetime, timedelta
import requests
import bleach
import dateutil.parser
import pytz
import requests_cache
from django.utils.html import strip_tags
from events.models import (
DataSource,
Event,
Keyword,
Place
)
from django_orghierarchy.models... | true | true |
f7459bfa4d929b7a937b53849f0610d682c60491 | 2,325 | py | Python | materializationengine/workflows/dummy_workflow.py | seung-lab/MaterializationEngine | b0dbda304db3f90c3e619edace6328dcf1b33f94 | [
"MIT"
] | null | null | null | materializationengine/workflows/dummy_workflow.py | seung-lab/MaterializationEngine | b0dbda304db3f90c3e619edace6328dcf1b33f94 | [
"MIT"
] | 14 | 2021-05-28T00:05:37.000Z | 2022-03-22T18:37:27.000Z | materializationengine/workflows/dummy_workflow.py | seung-lab/MaterializationEngine | b0dbda304db3f90c3e619edace6328dcf1b33f94 | [
"MIT"
] | null | null | null | import time
from celery import chain, chord
from celery.utils.log import get_task_logger
from materializationengine.celery_init import celery
from materializationengine.shared_tasks import fin
celery_logger = get_task_logger(__name__)
@celery.task(name="process:start_test_workflow")
def start_test_workflow(iterator... | 26.724138 | 86 | 0.630538 | import time
from celery import chain, chord
from celery.utils.log import get_task_logger
from materializationengine.celery_init import celery
from materializationengine.shared_tasks import fin
celery_logger = get_task_logger(__name__)
@celery.task(name="process:start_test_workflow")
def start_test_workflow(iterator... | true | true |
f7459cfe6074d7b225034ace38083d44b226c8a4 | 449 | py | Python | jetbrains-academy/Numeric Matrix Processor/Problems/Piggy bank/task.py | robinpatra/ML-Study-3 | 6f401706a8da4cac5e63304ce09ff6ff62756d0b | [
"MIT"
] | null | null | null | jetbrains-academy/Numeric Matrix Processor/Problems/Piggy bank/task.py | robinpatra/ML-Study-3 | 6f401706a8da4cac5e63304ce09ff6ff62756d0b | [
"MIT"
] | null | null | null | jetbrains-academy/Numeric Matrix Processor/Problems/Piggy bank/task.py | robinpatra/ML-Study-3 | 6f401706a8da4cac5e63304ce09ff6ff62756d0b | [
"MIT"
] | null | null | null | class PiggyBank:
# create __init__ and add_money methods
def __init__(self, dollars, cents):
self.dollars = dollars
self.cents = cents
def add_money(self, deposit_dollars, deposit_cents):
self.dollars += deposit_dollars
self.cents += deposit_cents
if self.cents >= 10... | 32.071429 | 56 | 0.616927 | class PiggyBank:
def __init__(self, dollars, cents):
self.dollars = dollars
self.cents = cents
def add_money(self, deposit_dollars, deposit_cents):
self.dollars += deposit_dollars
self.cents += deposit_cents
if self.cents >= 100:
to_dollar = int(self.cen... | true | true |
f7459d25fd7b1e2cce706d7503fd1caacff6c2d3 | 16,966 | py | Python | cgat/tools/bam2wiggle.py | cgat-developers/cgat-apps | 4de381418e80cfd085b17fc8a3048a48f55e57cf | [
"BSD-2-Clause",
"MIT"
] | 19 | 2018-09-07T11:32:49.000Z | 2021-08-24T01:39:37.000Z | cgat/tools/bam2wiggle.py | cgat-developers/cgat-apps | 4de381418e80cfd085b17fc8a3048a48f55e57cf | [
"BSD-2-Clause",
"MIT"
] | 55 | 2018-04-05T15:26:41.000Z | 2022-03-17T09:27:43.000Z | cgat/tools/bam2wiggle.py | cgat-developers/cgat-apps | 4de381418e80cfd085b17fc8a3048a48f55e57cf | [
"BSD-2-Clause",
"MIT"
] | 12 | 2018-02-11T20:07:03.000Z | 2021-04-07T04:50:12.000Z | """bam2wiggle.py - convert bam to wig/bigwig file
==============================================
:Tags: Genomics NGS Intervals Conversion BAM WIGGLE BIGWIG BEDGRAPH
Purpose
-------
convert a bam file to a bigwig or bedgraph file.
Depending on options chosen, this script either computes the densities
itself or makes... | 36.17484 | 88 | 0.545562 |
import os
import sys
import tempfile
import shutil
import subprocess
import cgatcore.experiment as E
import pysam
import cgatcore.iotools as iotools
from cgat.BamTools.bamtools import merge_pairs
class SpanWriter(object):
def __init__(self, span):
self.span = span
self.laststart = 0
sel... | true | true |
f7459df24059d2013a6f67fb04115a680542aa8c | 20,107 | py | Python | test/test_datetime.py | nehaljwani/orjson | 669e4a269023b222a1f0ffa572947b37d06415a3 | [
"Apache-2.0",
"MIT"
] | 3,041 | 2018-11-26T08:15:46.000Z | 2022-03-31T22:14:51.000Z | test/test_datetime.py | brandery/orjson | 02d6805af278493f657c17305a2f0cc054f04078 | [
"Apache-2.0",
"MIT"
] | 240 | 2018-11-25T20:01:02.000Z | 2022-03-31T19:48:08.000Z | test/test_datetime.py | brandery/orjson | 02d6805af278493f657c17305a2f0cc054f04078 | [
"Apache-2.0",
"MIT"
] | 145 | 2018-12-20T08:54:32.000Z | 2022-03-30T06:17:47.000Z | # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import datetime
import sys
import unittest
import pytest
import pytz
from dateutil import tz
import orjson
try:
import pendulum
except ImportError:
pendulum = None # type: ignore
if sys.version_info >= (3, 9):
import zoneinfo
class DatetimeTests(unittes... | 28.765379 | 88 | 0.440145 |
import datetime
import sys
import unittest
import pytest
import pytz
from dateutil import tz
import orjson
try:
import pendulum
except ImportError:
pendulum = None
if sys.version_info >= (3, 9):
import zoneinfo
class DatetimeTests(unittest.TestCase):
def test_datetime_naive(self):
self... | true | true |
f7459e0109e6d70c5524d3795e26e3e3135442f0 | 3,414 | py | Python | tests/python/pants_test/reporting/test_linkify.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2020-06-13T22:01:39.000Z | 2020-06-13T22:01:39.000Z | tests/python/pants_test/reporting/test_linkify.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/reporting/test_linkify.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import shutil
import tempfile
import unittest
from pants.reporting.linkify import linkify
def ensure_dir_exists(path):
os.makedirs(path)
def ensure_file_exists(path):
... | 34.484848 | 81 | 0.676919 |
import os
import shutil
import tempfile
import unittest
from pants.reporting.linkify import linkify
def ensure_dir_exists(path):
os.makedirs(path)
def ensure_file_exists(path):
ensure_dir_exists(os.path.dirname(path))
open(path, "a").close()
class LinkifyTest(unittest.TestCase):
def setUp(self... | true | true |
f7459e23ecfa9445703e370e3303045a6b9e434b | 559 | py | Python | tests/unit/endpoints/test_scoring.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | 1 | 2021-07-27T12:45:48.000Z | 2021-07-27T12:45:48.000Z | tests/unit/endpoints/test_scoring.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | null | null | null | tests/unit/endpoints/test_scoring.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | 1 | 2021-07-27T12:45:38.000Z | 2021-07-27T12:45:38.000Z | import unittest
from .context import BasicEndpointTestSuite
class EndPointScoring(BasicEndpointTestSuite):
def test_dice(self):
response = self.client.post("/scoring/dice?run_sync=true")
assert response.status_code == 200
def test_sum(self):
response = self.client.post("/scoring/sum?... | 23.291667 | 66 | 0.676208 | import unittest
from .context import BasicEndpointTestSuite
class EndPointScoring(BasicEndpointTestSuite):
def test_dice(self):
response = self.client.post("/scoring/dice?run_sync=true")
assert response.status_code == 200
def test_sum(self):
response = self.client.post("/scoring/sum?... | true | true |
f7459f09d28d53655619039fbd85e042e3508d89 | 1,425 | py | Python | lib/nummath/deriv.py | TomLXXVI/pipe-network-sim | c2307aba3138bc87ebb24f48e5299149db893ea9 | [
"MIT"
] | 4 | 2020-05-26T01:11:08.000Z | 2021-09-15T20:24:31.000Z | source_code/nummath/deriv.py | robertspark/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | null | null | null | source_code/nummath/deriv.py | robertspark/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | 1 | 2022-01-19T20:26:11.000Z | 2022-01-19T20:26:11.000Z | import numpy as np
class Deriv:
"""
Calculate the derivative with given order of the function f(t) at point t.
"""
def __init__(self, f, dt, o=1):
"""
Initialize the differentiation solver.
Params:
- f the name of the function object ('def f(t):...')
... | 34.756098 | 82 | 0.485614 | import numpy as np
class Deriv:
def __init__(self, f, dt, o=1):
self.f = f
self.dt = dt
self.o = o
self.co = np.array([
[-3.0, 4.0, -1.0, 0.0, 0.0, 0.0],
[2.0, -5.0, 4.0, -1.0, 0.0, 0.0],
[-5.0, 18.0, -24.0, 14.0, -3.0, 0.0],
... | true | true |
f7459f1af25e817438b4fba683395a1e8cb315aa | 625 | py | Python | users/auth/token_cache.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | users/auth/token_cache.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | users/auth/token_cache.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | from django.core.cache import cache
def set_cache(user_no, token):
cache.set('token:userno:' + user_no, token, timeout=None)
cache.set('token:value:'+ token, user_no, timeout=None)
def get_token_from_cache(user_no):
try:
token = cache.get('token:userno:' + user_no)
except:
tok... | 26.041667 | 65 | 0.656 | from django.core.cache import cache
def set_cache(user_no, token):
cache.set('token:userno:' + user_no, token, timeout=None)
cache.set('token:value:'+ token, user_no, timeout=None)
def get_token_from_cache(user_no):
try:
token = cache.get('token:userno:' + user_no)
except:
tok... | true | true |
f745a037f608eeb5834f1ac769fac3bd69686f31 | 6,530 | py | Python | pybfbc2stats/packet.py | cetteup/pybfbc2stats | 584f1bf1bb066b8930776a6dac7d40f4e7676848 | [
"MIT"
] | 1 | 2022-02-10T08:42:44.000Z | 2022-02-10T08:42:44.000Z | pybfbc2stats/packet.py | cetteup/pybfbc2stats | 584f1bf1bb066b8930776a6dac7d40f4e7676848 | [
"MIT"
] | null | null | null | pybfbc2stats/packet.py | cetteup/pybfbc2stats | 584f1bf1bb066b8930776a6dac7d40f4e7676848 | [
"MIT"
] | null | null | null | from typing import List, Optional
from .constants import HEADER_LENGTH, VALID_HEADER_TYPES_FESL, VALID_HEADER_TYPES_THEATER, \
VALID_HEADER_ERROR_INDICATORS, HEADER_BYTE_ORDER
from .exceptions import Error
class Packet:
header: bytes
body: bytes
def __init__(self, header: bytes = b'', body: bytes = ... | 33.834197 | 118 | 0.613629 | from typing import List, Optional
from .constants import HEADER_LENGTH, VALID_HEADER_TYPES_FESL, VALID_HEADER_TYPES_THEATER, \
VALID_HEADER_ERROR_INDICATORS, HEADER_BYTE_ORDER
from .exceptions import Error
class Packet:
header: bytes
body: bytes
def __init__(self, header: bytes = b'', body: bytes = ... | true | true |
f745a11455a257cf26aaefd12f24da3c23d3f64c | 10,686 | py | Python | flowkit/tests/flowjo_wsp_tests.py | whitews/FlowK | d4e43a0488606ce5479b5110486dc3db128f6a87 | [
"BSD-3-Clause"
] | 73 | 2019-02-18T01:03:06.000Z | 2022-03-18T14:03:01.000Z | flowkit/tests/flowjo_wsp_tests.py | whitews/FlowK | d4e43a0488606ce5479b5110486dc3db128f6a87 | [
"BSD-3-Clause"
] | 90 | 2019-01-28T22:04:04.000Z | 2022-03-31T16:40:14.000Z | flowkit/tests/flowjo_wsp_tests.py | whitews/FlowK | d4e43a0488606ce5479b5110486dc3db128f6a87 | [
"BSD-3-Clause"
] | 8 | 2019-08-19T16:58:48.000Z | 2022-01-11T08:55:23.000Z | """
Tests for FlowJo 10 workspace files
"""
import copy
import unittest
import os
from io import BytesIO
import numpy as np
from flowkit import Session, gates, transforms
from .session_tests import test_samples_8c_full_set
class FlowJoWSPTestCase(unittest.TestCase):
def test_load_wsp_single_poly(self):
ws... | 38.717391 | 101 | 0.67565 | import copy
import unittest
import os
from io import BytesIO
import numpy as np
from flowkit import Session, gates, transforms
from .session_tests import test_samples_8c_full_set
class FlowJoWSPTestCase(unittest.TestCase):
def test_load_wsp_single_poly(self):
wsp_path = "examples/data/simple_line_example/... | true | true |
f745a135aedfdc0bdb3d5110cc6e6abe0ed264b9 | 610 | py | Python | pbr/__init__.py | citrix-openstack-build/pbr | 9f04dba0ecc07a33dc4b256bec4f860c30b2b500 | [
"Apache-2.0"
] | 8 | 2015-03-19T20:22:44.000Z | 2021-04-11T06:00:52.000Z | venv/lib/python2.7/site-packages/pbr/__init__.py | wbonack/witty-name | 07a4babed5b4ff4846c10268a65975c6c800de2b | [
"BSD-3-Clause"
] | 1 | 2015-07-21T23:05:23.000Z | 2016-03-16T08:11:54.000Z | venv/lib/python2.7/site-packages/pbr/__init__.py | wbonack/witty-name | 07a4babed5b4ff4846c10268a65975c6c800de2b | [
"BSD-3-Clause"
] | 5 | 2015-10-09T17:42:24.000Z | 2021-03-11T18:33:00.000Z | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.666667 | 69 | 0.760656 | true | true | |
f745a2afd2932c07137cfe348dbf71260825ba7e | 3,294 | py | Python | parser/team29/analizer/statement/instructions/create/create_index.py | AndreeAvalos/tytus | 7432c604bd1dddc9714443f44e0d498e6a005c5d | [
"MIT"
] | null | null | null | parser/team29/analizer/statement/instructions/create/create_index.py | AndreeAvalos/tytus | 7432c604bd1dddc9714443f44e0d498e6a005c5d | [
"MIT"
] | null | null | null | parser/team29/analizer/statement/instructions/create/create_index.py | AndreeAvalos/tytus | 7432c604bd1dddc9714443f44e0d498e6a005c5d | [
"MIT"
] | null | null | null | from analizer.abstract import instruction
from analizer.reports import Nodo
from analizer.typechecker.Metadata import File
from analizer.typechecker.Metadata import Struct
class CreateIndex(instruction.Instruction):
def __init__(self, unique, idIndex, idTable, usingMethod, whereCl, optList=[]):
self.uniqu... | 32.294118 | 109 | 0.497571 | from analizer.abstract import instruction
from analizer.reports import Nodo
from analizer.typechecker.Metadata import File
from analizer.typechecker.Metadata import Struct
class CreateIndex(instruction.Instruction):
def __init__(self, unique, idIndex, idTable, usingMethod, whereCl, optList=[]):
self.uniqu... | true | true |
f745a3e1dd8614d2fabe0b6fc24cad56355cffd6 | 6,869 | py | Python | pyparse/core/data/query.py | sodastsai/pyparse | 17396083883a822050a3cf2cdda838e5e909c136 | [
"Apache-2.0"
] | null | null | null | pyparse/core/data/query.py | sodastsai/pyparse | 17396083883a822050a3cf2cdda838e5e909c136 | [
"Apache-2.0"
] | null | null | null | pyparse/core/data/query.py | sodastsai/pyparse | 17396083883a822050a3cf2cdda838e5e909c136 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Tickle Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 31.654378 | 120 | 0.588004 |
from copy import copy
import json
from pyparse.core.data.types import ParseConvertible
from pyparse.core.data.object import ObjectBase
from pyparse.request import request_parse
class Query(object):
def __init__(self, object_class=None, class_name=None):
assert bool(object_class) ^ bool(c... | true | true |
f745a495b467c428c4117186788fc4a07f26fa4d | 2,742 | py | Python | src/fsm/tests/python/fsm_tests/fsm_tests.py | c-piyushjhamb/opensync | e122cc4f1a7df1b05b054c40ec14251c11614285 | [
"BSD-3-Clause"
] | 67 | 2018-11-06T16:40:18.000Z | 2022-03-09T13:20:01.000Z | src/fsm/tests/python/fsm_tests/fsm_tests.py | c-piyushjhamb/opensync | e122cc4f1a7df1b05b054c40ec14251c11614285 | [
"BSD-3-Clause"
] | 18 | 2019-07-26T16:49:55.000Z | 2021-06-23T21:01:03.000Z | src/fsm/tests/python/fsm_tests/fsm_tests.py | c-piyushjhamb/opensync | e122cc4f1a7df1b05b054c40ec14251c11614285 | [
"BSD-3-Clause"
] | 77 | 2018-10-24T11:02:03.000Z | 2022-03-03T02:14:26.000Z | #!/usr/bin/env python3
import argparse
import configparser
import copy
import logging
import os
import stat
import sys
import lib.fsm_config as fsm_config
import lib.tags as tag
import lib.iface as tap
import lib.flows as flow
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLog... | 33.439024 | 106 | 0.645879 |
import argparse
import configparser
import copy
import logging
import os
import stat
import sys
import lib.fsm_config as fsm_config
import lib.tags as tag
import lib.iface as tap
import lib.flows as flow
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLogger(__file__)
def gen... | true | true |
f745a4d0d99c52372c7255a4ca1a7051224768bc | 1,604 | py | Python | swift/common/middleware/slo.py | IPVL/swift_test | 41d1ee3d575036a0788425b20da87aeee00bb605 | [
"MIT"
] | null | null | null | swift/common/middleware/slo.py | IPVL/swift_test | 41d1ee3d575036a0788425b20da87aeee00bb605 | [
"MIT"
] | null | null | null | swift/common/middleware/slo.py | IPVL/swift_test | 41d1ee3d575036a0788425b20da87aeee00bb605 | [
"MIT"
] | null | null | null | from swift.ipvl.inspect_custom import whoami, whosdaddy
pass # (WIS) print __name__
class StaticLargeObject(object):
"""docstring for StaticLargeObject"""
def __init__(self, app, conf):
pass # (WIS) print "%s %s (%s -> %s)" % (__name__, self.__class__.__name__, whosdaddy(), whoami())
self.... | 39.121951 | 107 | 0.592893 | from swift.ipvl.inspect_custom import whoami, whosdaddy
pass
class StaticLargeObject(object):
def __init__(self, app, conf):
pass
self.app = app
self.conf = conf
def __call__(self, env, start_response):
pass
start_response('200 OK', [('Content-Type', 'text/plai... | true | true |
f745a50e631e41afc6423a8d93a0cfbfc06dc3f7 | 4,407 | py | Python | userbot/modules/quotly.py | AngkasaBoy/SpaceMan | 578039395046ba7a987cf220ecfc4bee82b285d3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2021-05-02T22:01:34.000Z | 2021-06-20T08:25:41.000Z | userbot/modules/quotly.py | AngkasaBoy/SpaceMan | 578039395046ba7a987cf220ecfc4bee82b285d3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/quotly.py | AngkasaBoy/SpaceMan | 578039395046ba7a987cf220ecfc4bee82b285d3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2021-03-20T23:46:21.000Z | 2021-05-02T22:01:47.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Port From UniBorg to UserBot by MoveAngel
import random
import requests
from asyncio.exceptions import TimeoutError
... | 38.657895 | 95 | 0.6054 |
import random
import requests
from asyncio.exceptions import TimeoutError
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot import CMD_HELP, bot
from userbot.events import register
if 1 == 1:
strings = {
"name": "Quotes",
"api_token_cfg_do... | true | true |
f745a5be8e803ad34c9d4c9efd3a60dd05693d4b | 14,451 | py | Python | Python/DocStruct/ASAPI/Client.py | appcove/DocStruct | 16c15bb59f9aab29abb78b0aa9f2ab63c10b8da4 | [
"Apache-2.0"
] | 1 | 2015-06-18T07:30:02.000Z | 2015-06-18T07:30:02.000Z | Python/DocStruct/ASAPI/Client.py | appcove/DocStruct | 16c15bb59f9aab29abb78b0aa9f2ab63c10b8da4 | [
"Apache-2.0"
] | null | null | null | Python/DocStruct/ASAPI/Client.py | appcove/DocStruct | 16c15bb59f9aab29abb78b0aa9f2ab63c10b8da4 | [
"Apache-2.0"
] | null | null | null | # vim:fileencoding=utf-8:ts=2:sw=2:expandtab
import json
import mimetypes
import traceback
from datetime import datetime, timezone, timedelta
from collections import OrderedDict
from AppStruct.Util import aadict
from AppStruct.Security import RandomHex
from ..Base import GetSession, S3, SQS
from . import AWS
class... | 32.547297 | 146 | 0.620995 |
import json
import mimetypes
import traceback
from datetime import datetime, timezone, timedelta
from collections import OrderedDict
from AppStruct.Util import aadict
from AppStruct.Security import RandomHex
from ..Base import GetSession, S3, SQS
from . import AWS
class AWSConfig(object):
def __init__(self, Co... | true | true |
f745a5d407f47d5271029ccca1671bc66863a918 | 5,982 | py | Python | tensor2tensor/utils/multistep_optimizer.py | hushukai/tf-tensor2tensor | 6e685f57ed170bb7f887271d7bbd58cf57eb6af7 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/utils/multistep_optimizer.py | hushukai/tf-tensor2tensor | 6e685f57ed170bb7f887271d7bbd58cf57eb6af7 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/utils/multistep_optimizer.py | hushukai/tf-tensor2tensor | 6e685f57ed170bb7f887271d7bbd58cf57eb6af7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 43.347826 | 80 | 0.703778 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
class MultistepAdamOptimizer(tf.compat.v1.train.AdamOptimizer):
def __init__(self, learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-8,
... | true | true |
f745a63ff0e16aed4fc17de6b74261ad9669dbe4 | 103,212 | py | Python | tests/unit/gapic/bigtable_v2/test_bigtable.py | mf2199/python-bigtable | ee3a6c4c5f810fab08671db3407195864ecc1972 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/bigtable_v2/test_bigtable.py | mf2199/python-bigtable | ee3a6c4c5f810fab08671db3407195864ecc1972 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/bigtable_v2/test_bigtable.py | mf2199/python-bigtable | ee3a6c4c5f810fab08671db3407195864ecc1972 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.598355 | 104 | 0.67278 |
import os
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from... | true | true |
f745a6c804ddd25ad1ebcf82383b2f450a5738e4 | 8,727 | py | Python | blindbackup/client.py | nagylzs/blindbackup | fa0c7a6ef42bb5aefec99eff69a3227c8695fdd9 | [
"Apache-2.0"
] | 1 | 2020-01-26T05:46:14.000Z | 2020-01-26T05:46:14.000Z | blindbackup/client.py | nagylzs/blindbackup | fa0c7a6ef42bb5aefec99eff69a3227c8695fdd9 | [
"Apache-2.0"
] | null | null | null | blindbackup/client.py | nagylzs/blindbackup | fa0c7a6ef42bb5aefec99eff69a3227c8695fdd9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import copy
import io
import json
import os.path
import pycurl
import urllib.parse
from blindbackup.util import localpath
def create_client(settings):
certfile = localpath(settings, "ssl_certfile", None)
return Client(
settings["server_url"], certfile,
settings["login"]... | 33.825581 | 133 | 0.58531 |
import copy
import io
import json
import os.path
import pycurl
import urllib.parse
from blindbackup.util import localpath
def create_client(settings):
certfile = localpath(settings, "ssl_certfile", None)
return Client(
settings["server_url"], certfile,
settings["login"], settings["password"]... | true | true |
f745a8efaa5ed62c6f00d0c3ebbcd28d06774854 | 850 | py | Python | armulator/armv6/opcodes/abstract_opcodes/and_immediate.py | matan1008/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 16 | 2018-01-22T14:36:49.000Z | 2021-12-17T15:39:52.000Z | armulator/armv6/opcodes/abstract_opcodes/and_immediate.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 3 | 2019-02-19T17:51:47.000Z | 2022-03-31T20:45:21.000Z | armulator/armv6/opcodes/abstract_opcodes/and_immediate.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 4 | 2020-06-18T23:51:03.000Z | 2022-02-09T17:43:13.000Z | from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
class AndImmediate(AbstractOpcode):
def __init__(self, setflags, d, n, imm32, carry):
super(AndImmediate, self).__init__()
self.setflags = setflags
self.d = d
self.n = n
self.imm32 = imm32
self.carry... | 35.416667 | 69 | 0.591765 | from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
class AndImmediate(AbstractOpcode):
def __init__(self, setflags, d, n, imm32, carry):
super(AndImmediate, self).__init__()
self.setflags = setflags
self.d = d
self.n = n
self.imm32 = imm32
self.carry... | true | true |
f745aa8573b2ce77ab8c424f4efb2c223b3a8c6e | 4,269 | py | Python | src/tests/ftest/aggregation/io_small.py | daos-stack/daos-core | 41fea89f5f63212ea43d9f1fc8974bb6ae875449 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/aggregation/io_small.py | daos-stack/daos-core | 41fea89f5f63212ea43d9f1fc8974bb6ae875449 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/aggregation/io_small.py | daos-stack/daos-core | 41fea89f5f63212ea43d9f1fc8974bb6ae875449 | [
"BSD-2-Clause-Patent"
] | null | null | null | #!/usr/bin/python
"""
(C) Copyright 2020-2022 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
from ior_test_base import IorTestBase
from general_utils import human_to_bytes
class DaosAggregationIOSmall(IorTestBase):
# pylint: disable=too-many-ancestors,too-few-public-methods
... | 38.459459 | 80 | 0.646053 |
import time
from ior_test_base import IorTestBase
from general_utils import human_to_bytes
class DaosAggregationIOSmall(IorTestBase):
def test_aggregation_io_small(self):
self.update_ior_cmd_with_pool()
scm_index = 0
ssd_index = 1
block_size = hu... | true | true |
f745aabe794cc25ba4b2b6225a3914d2e99e5882 | 9,709 | py | Python | data/params.py | liulisixin/unsupervised-learning-intrinsic-images | 0d4ad151d203885c87122bcc305c787210b28a5c | [
"MIT"
] | 61 | 2018-04-05T21:17:28.000Z | 2019-08-10T08:43:58.000Z | data/params.py | liulisixin/unsupervised-learning-intrinsic-images | 0d4ad151d203885c87122bcc305c787210b28a5c | [
"MIT"
] | 4 | 2018-07-06T13:38:27.000Z | 2019-08-03T09:37:10.000Z | data/params.py | liulisixin/unsupervised-learning-intrinsic-images | 0d4ad151d203885c87122bcc305c787210b28a5c | [
"MIT"
] | 13 | 2019-08-13T02:11:54.000Z | 2021-07-06T09:27:27.000Z | import copy
import json
import random
import hashlib
import numpy as np
class IntrinsicParameters():
""" Global parameter values for the algorithm """
def __init__(self):
#: if True, print progress to the console
self.logging = False
#: if True, use a fixed seed for k-means clusteri... | 31.21865 | 81 | 0.604697 | import copy
import json
import random
import hashlib
import numpy as np
class IntrinsicParameters():
def __init__(self):
self.logging = False
self.fixed_seed = False
self.n_iters = 25
self.n_crf_iters = 10
self.split_cluste... | true | true |
f745ab4824ac364b51758e6c3fb60a5679d210fb | 29,676 | py | Python | tensorflow/python/training/checkpoint_management.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 5 | 2018-07-04T22:14:02.000Z | 2018-07-04T22:21:43.000Z | tensorflow/python/training/checkpoint_management.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/checkpoint_management.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 2 | 2019-10-11T00:17:03.000Z | 2020-05-23T18:59:45.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.915254 | 80 | 0.720077 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os.path
import re
import time
from google.protobuf import text_format
from tensorflow.core.protobuf import saver_pb2
from tensorflow.python.eager import context
from ... | true | true |
f745ab6e57f48b737a0b5e00e3121d9dba5e352c | 1,628 | py | Python | lemonsoap/scent/impute_scent.py | Ekrekr/LemonSoap | 61b86b70a3788486235de2e8baeb7c68b80318a9 | [
"MIT"
] | null | null | null | lemonsoap/scent/impute_scent.py | Ekrekr/LemonSoap | 61b86b70a3788486235de2e8baeb7c68b80318a9 | [
"MIT"
] | 1 | 2019-08-23T18:30:31.000Z | 2019-08-23T18:32:23.000Z | lemonsoap/scent/impute_scent.py | Ekrekr/LemonSoap | 61b86b70a3788486235de2e8baeb7c68b80318a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
LemonSoap - impute scent.
Determines which columns have potentially sequential data, and if so offers to
estimate values.
* Missing completely at random (MCAR)
* Missing at random (MAR)
* Not missing at random (NMAR)
1. If numerical:
1. If constant, then fill in with same values.
... | 22 | 78 | 0.624079 |
import pandas as pd
import logging
from .scent_template import ScentTemplate
from ..lemon_bar import LemonBar
class ImputeScent(ScentTemplate):
def __init__(self, lf: LemonBar):
ScentTemplate.__init__(self, lf, "impute",
"impute_scent.ImputeScent")
def check(self) -> ... | true | true |
f745ac03a914918c2f01b2d0f56890719ca0ab7e | 11,520 | py | Python | afterglow_core/resources/data_provider_plugins/imaging_survey_provider.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 2 | 2021-05-24T15:12:07.000Z | 2022-02-17T19:58:16.000Z | afterglow_core/resources/data_provider_plugins/imaging_survey_provider.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 1 | 2022-02-27T03:01:06.000Z | 2022-02-27T03:01:06.000Z | afterglow_core/resources/data_provider_plugins/imaging_survey_provider.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 2 | 2021-06-08T18:16:40.000Z | 2021-07-09T14:19:49.000Z | """
Afterglow Core: imaging survey data provider plugin
"""
from typing import List as TList, Optional, Tuple, Union
from io import BytesIO
from threading import Lock
from astropy import units as u
from astropy.coordinates import Angle
from astroquery.skyview import SkyView
from ...models import DataProvider, DataP... | 37.770492 | 79 | 0.571962 |
from typing import List as TList, Optional, Tuple, Union
from io import BytesIO
from threading import Lock
from astropy import units as u
from astropy.coordinates import Angle
from astroquery.skyview import SkyView
from ...models import DataProvider, DataProviderAsset
from ...errors import MissingFieldError, Valida... | true | true |
f745ac54b738685c5e2840208907ee4e742a4f9e | 5,755 | py | Python | code/test_util.py | mantuoluozk/MFC | e296d7a8e345bc2ca404b5f0fb7f5048f9c5f0d3 | [
"MIT"
] | null | null | null | code/test_util.py | mantuoluozk/MFC | e296d7a8e345bc2ca404b5f0fb7f5048f9c5f0d3 | [
"MIT"
] | null | null | null | code/test_util.py | mantuoluozk/MFC | e296d7a8e345bc2ca404b5f0fb7f5048f9c5f0d3 | [
"MIT"
] | null | null | null | import h5py
import math
import nibabel as nib
import numpy as np
from medpy import metric
import torch
import torch.nn.functional as F
from tqdm import tqdm
from skimage.measure import label
def getLargestCC(segmentation):
labels = label(segmentation)
assert(labels.max() != 0) # assume at least 1 CC
larg... | 37.37013 | 181 | 0.575326 | import h5py
import math
import nibabel as nib
import numpy as np
from medpy import metric
import torch
import torch.nn.functional as F
from tqdm import tqdm
from skimage.measure import label
def getLargestCC(segmentation):
labels = label(segmentation)
assert(labels.max() != 0)
largestCC = labels == np.a... | true | true |
f745ad50c0969afae56e31759a8ede1624e56388 | 9,361 | py | Python | codesearch/__main__.py | chromium/codesearch-py | 41c53c1462b0f9c4031163d8927edafcc56c9659 | [
"BSD-3-Clause"
] | 26 | 2017-05-24T18:51:18.000Z | 2022-03-17T19:44:15.000Z | codesearch/__main__.py | chromium/codesearch-py | 41c53c1462b0f9c4031163d8927edafcc56c9659 | [
"BSD-3-Clause"
] | 10 | 2017-06-06T17:33:33.000Z | 2020-08-08T18:47:18.000Z | codesearch/__main__.py | QPC-database/codesearch-py | a4b74e597bc78ec9492efc8b741129a410af14a7 | [
"BSD-3-Clause"
] | 16 | 2017-06-02T10:36:56.000Z | 2021-07-03T22:41:09.000Z | # Copyright 2017 The Chromium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd.
"""Command line interface to Chromium Code Search.
Currently emits JSON formatted responses from the Chromium Cod... | 35.324528 | 80 | 0.591497 |
from __future__ import absolute_import
from __future__ import print_function
import os
import argparse
import sys
import json
import logging
from codesearch import \
CallGraphRequest, \
CodeSearch, \
CodeSearchProtoJsonEncoder, \
CodeSearchProtoJsonSymbolizedEncoder, \
CompoundRequest, \
... | true | true |
f745ad649c1a43fb1bb089f4fc14e5bb6e087001 | 997 | py | Python | create_tw.py | alexjj/wiki | ddafb2ea872118c75343d15b92e628c8a1eb6544 | [
"MIT"
] | null | null | null | create_tw.py | alexjj/wiki | ddafb2ea872118c75343d15b92e628c8a1eb6544 | [
"MIT"
] | null | null | null | create_tw.py | alexjj/wiki | ddafb2ea872118c75343d15b92e628c8a1eb6544 | [
"MIT"
] | null | null | null | #%%
import json
with open("meditations.json", "r") as read_file:
data = json.load(read_file)
#%%
book_names = [
"Book I",
"Book II",
"Book III",
"Book IV",
"Book V",
"Book VI",
"Book VII",
"Book VIII",
"Book IX",
"Book X",
"Book XI",
"Book XII",
]
result = []
... | 19.54902 | 59 | 0.531595 |
import json
with open("meditations.json", "r") as read_file:
data = json.load(read_file)
book_names = [
"Book I",
"Book II",
"Book III",
"Book IV",
"Book V",
"Book VI",
"Book VII",
"Book VIII",
"Book IX",
"Book X",
"Book XI",
"Book XII",
]
result = []
for b... | true | true |
f745adb4fda92474b18fc7b215ad072c3dbc4840 | 66,180 | py | Python | src/reg_masternode_dlg.py | walkjivefly/crown-masternode-tool | 8eb5969a2dce87221997b128f02c9c33f9deeafd | [
"MIT"
] | null | null | null | src/reg_masternode_dlg.py | walkjivefly/crown-masternode-tool | 8eb5969a2dce87221997b128f02c9c33f9deeafd | [
"MIT"
] | null | null | null | src/reg_masternode_dlg.py | walkjivefly/crown-masternode-tool | 8eb5969a2dce87221997b128f02c9c33f9deeafd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-11
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, Q... | 46.409537 | 201 | 0.614053 |
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import pyqtSlot, Qt, QTimerEvent, QTimer
from PyQt5.QtGui import... | true | true |
f745ae46260a7b31aa69f784ff95b4ad3bef4a74 | 573 | py | Python | riverstone_cli/commands/wireframe/__init__.py | dev-tooling/github-cli | a8b72d066b2e7e3e7046a4d2a06845d8fce9678c | [
"Apache-2.0"
] | null | null | null | riverstone_cli/commands/wireframe/__init__.py | dev-tooling/github-cli | a8b72d066b2e7e3e7046a4d2a06845d8fce9678c | [
"Apache-2.0"
] | null | null | null | riverstone_cli/commands/wireframe/__init__.py | dev-tooling/github-cli | a8b72d066b2e7e3e7046a4d2a06845d8fce9678c | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2018 Riverstone Software, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | 35.8125 | 72 | 0.78534 | true | true | |
f745ae9e849cf63571179e4fe9e7914971ceb3ec | 1,585 | py | Python | opentuner/driverbase.py | HansGiesen/opentuner | 6eabebd502ea46072d1a149826f5fbdaa4cf98ef | [
"MIT"
] | 1 | 2019-09-10T15:59:11.000Z | 2019-09-10T15:59:11.000Z | opentuner/driverbase.py | HansGiesen/opentuner | 6eabebd502ea46072d1a149826f5fbdaa4cf98ef | [
"MIT"
] | null | null | null | opentuner/driverbase.py | HansGiesen/opentuner | 6eabebd502ea46072d1a149826f5fbdaa4cf98ef | [
"MIT"
] | null | null | null | from opentuner.resultsdb.models import *
class DriverBase(object):
"""
shared base class between MeasurementDriver and SearchDriver
"""
def __init__(self,
session,
tuning_run,
objective,
tuning_run_main,
args,
**kwargs)... | 25.983607 | 62 | 0.615773 | from opentuner.resultsdb.models import *
class DriverBase(object):
def __init__(self,
session,
tuning_run,
objective,
tuning_run_main,
args,
**kwargs):
self.args = args
self.objective = objective
self.session = se... | true | true |
f745b15a500147dbdaeb050c729ae9f3009b5cb5 | 1,607 | py | Python | env/Lib/site-packages/plotly/validators/histogram/marker/__init__.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/histogram/marker/__init__.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/histogram/marker/__init__.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import sys
if sys.version_info < (3, 7):
from ._showscale import ShowscaleValidator
from ._reversescale import ReversescaleValidator
from ._pattern import PatternValidator
from ._opacitysrc import OpacitysrcValidator
from ._opacity import OpacityValidator
from ._line import LineValidator
fr... | 35.711111 | 56 | 0.676416 | import sys
if sys.version_info < (3, 7):
from ._showscale import ShowscaleValidator
from ._reversescale import ReversescaleValidator
from ._pattern import PatternValidator
from ._opacitysrc import OpacitysrcValidator
from ._opacity import OpacityValidator
from ._line import LineValidator
fr... | true | true |
f745b199eee72335c7787dff9d374a0157c928fd | 842 | py | Python | flaskr/db.py | jeckt/flask_official_tutorial | ca0f93d682bc9a0b372e537becde3a417af579f7 | [
"Apache-2.0"
] | null | null | null | flaskr/db.py | jeckt/flask_official_tutorial | ca0f93d682bc9a0b372e537becde3a417af579f7 | [
"Apache-2.0"
] | null | null | null | flaskr/db.py | jeckt/flask_official_tutorial | ca0f93d682bc9a0b372e537becde3a417af579f7 | [
"Apache-2.0"
] | null | null | null | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row
retu... | 21.589744 | 56 | 0.654394 | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row
retu... | true | true |
f745b1eb10a9577b2d6348c2e2aa76943081c95f | 4,905 | py | Python | retina_models/retinaface.py | zs7779/Pytorch_Retinaface | eeb92c28f3217da7439118ed89df8a83c75cc161 | [
"MIT"
] | null | null | null | retina_models/retinaface.py | zs7779/Pytorch_Retinaface | eeb92c28f3217da7439118ed89df8a83c75cc161 | [
"MIT"
] | null | null | null | retina_models/retinaface.py | zs7779/Pytorch_Retinaface | eeb92c28f3217da7439118ed89df8a83c75cc161 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from retina_models.net import MobileNetV1 as MobileNetV1
from retina_models.net import FPN as FPN
from r... | 38.622047 | 135 | 0.644241 | import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from retina_models.net import MobileNetV1 as MobileNetV1
from retina_models.net import FPN as FPN
from r... | true | true |
f745b21870591affce7dca38519560328f876fcc | 6,200 | py | Python | asteroid/models/demask.py | ldelebec/asteroid | d6390baca5409634f112ceed554ea66c4054cb54 | [
"MIT"
] | 722 | 2020-12-01T06:49:47.000Z | 2022-03-31T12:44:53.000Z | asteroid/models/demask.py | ldelebec/asteroid | d6390baca5409634f112ceed554ea66c4054cb54 | [
"MIT"
] | 235 | 2020-03-02T12:57:07.000Z | 2020-11-30T20:11:18.000Z | asteroid/models/demask.py | ldelebec/asteroid | d6390baca5409634f112ceed554ea66c4054cb54 | [
"MIT"
] | 176 | 2020-12-01T00:10:30.000Z | 2022-03-30T10:38:19.000Z | from torch import nn
from .base_models import BaseEncoderMaskerDecoder
from asteroid_filterbanks import make_enc_dec
from asteroid_filterbanks.transforms import mag, magreim
from ..masknn import norms, activations
from ..utils.torch_utils import pad_x_to_y
import warnings
class DeMask(BaseEncoderMaskerDecoder):
"... | 34.444444 | 115 | 0.609839 | from torch import nn
from .base_models import BaseEncoderMaskerDecoder
from asteroid_filterbanks import make_enc_dec
from asteroid_filterbanks.transforms import mag, magreim
from ..masknn import norms, activations
from ..utils.torch_utils import pad_x_to_y
import warnings
class DeMask(BaseEncoderMaskerDecoder):
... | true | true |
f745b244a94bea35e5ed9d42aa797470df8b0b77 | 24,728 | py | Python | sqlmodel/main.py | CaselIT/sqlmodel | b59d91ddd9e957a4cdf9dbb35704d7664de840f3 | [
"MIT"
] | 3 | 2021-09-13T18:20:23.000Z | 2022-02-07T16:13:07.000Z | sqlmodel/main.py | CaselIT/sqlmodel | b59d91ddd9e957a4cdf9dbb35704d7664de840f3 | [
"MIT"
] | 48 | 2021-08-30T14:17:14.000Z | 2022-02-14T14:54:16.000Z | sqlmodel/main.py | CaselIT/sqlmodel | b59d91ddd9e957a4cdf9dbb35704d7664de840f3 | [
"MIT"
] | 1 | 2021-10-30T12:06:42.000Z | 2021-10-30T12:06:42.000Z | import ipaddress
import uuid
import weakref
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from pathlib import Path
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
ClassVar,
Dict,
List,
Mapping,
Optional,
Seq... | 38.819466 | 88 | 0.629934 | import ipaddress
import uuid
import weakref
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from pathlib import Path
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
ClassVar,
Dict,
List,
Mapping,
Optional,
Seq... | true | true |
f745b28c3e2c67855346d9842cb0aa2802efb0a3 | 1,156 | py | Python | music/file_player.py | MaT1g3R/YasenBaka | c5ff3b0419801c2d37a86bac644d72ffff97d482 | [
"Apache-2.0"
] | 6 | 2017-04-08T15:16:17.000Z | 2019-06-22T20:14:39.000Z | music/file_player.py | MaT1g3R/YasenBaka | c5ff3b0419801c2d37a86bac644d72ffff97d482 | [
"Apache-2.0"
] | 8 | 2017-07-20T22:01:21.000Z | 2018-01-10T18:57:32.000Z | music/file_player.py | MaT1g3R/YasenBaka | c5ff3b0419801c2d37a86bac644d72ffff97d482 | [
"Apache-2.0"
] | 5 | 2017-11-23T21:25:51.000Z | 2019-06-22T20:14:46.000Z | from pathlib import Path
from random import shuffle
from discord import VoiceChannel
from music.abstract_music_player import AbstractMusicPlayer
from music.entry import Entry
class FilePlayer(AbstractMusicPlayer):
"""
Audio player for playing local files.
"""
__slots__ = ('default_path',)
def _... | 29.641026 | 77 | 0.654844 | from pathlib import Path
from random import shuffle
from discord import VoiceChannel
from music.abstract_music_player import AbstractMusicPlayer
from music.entry import Entry
class FilePlayer(AbstractMusicPlayer):
__slots__ = ('default_path',)
def __init__(self, logger, channel: VoiceChannel, default_path:... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.