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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7504a22d6a48f893d2b4c3e58872ec6ebae0b78 | 2,111 | py | Python | test_paolo/BiDAQ/backplane/portexpander/PCA9535.py | giachero/biDAQz | a6efb778bae4f327607c6699a91075e9988d1bef | [
"MIT"
] | null | null | null | test_paolo/BiDAQ/backplane/portexpander/PCA9535.py | giachero/biDAQz | a6efb778bae4f327607c6699a91075e9988d1bef | [
"MIT"
] | null | null | null | test_paolo/BiDAQ/backplane/portexpander/PCA9535.py | giachero/biDAQz | a6efb778bae4f327607c6699a91075e9988d1bef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# FROM: https://github.com/lucidm/i2lcd
import smbus
class PCA9535(object):
INPUT_PORT0 = 0
INPUT_PORT1 = 1
OUTPUT_PORT0 = 2
OUTPUT_PORT1 = 3
POL_INV0 = 4
POL_INV1 = 5
CONF_PORT0 = 6
CONF_PORT1 = 7
def __init__(self, bus, address):
self.bus = smbus... | 28.527027 | 85 | 0.644718 |
import smbus
class PCA9535(object):
INPUT_PORT0 = 0
INPUT_PORT1 = 1
OUTPUT_PORT0 = 2
OUTPUT_PORT1 = 3
POL_INV0 = 4
POL_INV1 = 5
CONF_PORT0 = 6
CONF_PORT1 = 7
def __init__(self, bus, address):
self.bus = smbus.SMBus(bus)
self.address = address
def setPort(se... | true | true |
f7504a7118da9bd0a81e0f690f092d5a22b12e71 | 55 | py | Python | pyfakeuse/__init__.py | veltzer/pyfakeuse | 79e1a533919f9022ac2f6747cbdb8a030fb3a230 | [
"MIT"
] | null | null | null | pyfakeuse/__init__.py | veltzer/pyfakeuse | 79e1a533919f9022ac2f6747cbdb8a030fb3a230 | [
"MIT"
] | null | null | null | pyfakeuse/__init__.py | veltzer/pyfakeuse | 79e1a533919f9022ac2f6747cbdb8a030fb3a230 | [
"MIT"
] | null | null | null | from pyfakeuse.pyfakeuse import fake_use # noqa: F401
| 27.5 | 54 | 0.8 | from pyfakeuse.pyfakeuse import fake_use
| true | true |
f7504ce3c2129d452007d4609794425ab78791e6 | 2,067 | py | Python | imagenet_training/models/simple_cnn.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/models/simple_cnn.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/models/simple_cnn.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | """A simple cnn model."""
import argparse
from collections import OrderedDict
from typing import Any, Dict, Optional
import torch
import torch.nn as nn
class SimpleCNN(nn.Module):
"""A simple CNN model.
Args:
data_config: a dictionary containing information about data.
args (optional): arg... | 30.397059 | 79 | 0.56507 |
import argparse
from collections import OrderedDict
from typing import Any, Dict, Optional
import torch
import torch.nn as nn
class SimpleCNN(nn.Module):
def __init__(
self,
data_config: Dict[str, Any],
args: Optional[argparse.Namespace] = None,
):
super().__init__()
... | true | true |
f7504ce96f8706707669321a03b0449d479548dc | 1,724 | py | Python | specmod/Models.py | sgjholt/SpecMod | 453c77c1fa51c220470e2aa4d92ec432360bfc9f | [
"MIT"
] | null | null | null | specmod/Models.py | sgjholt/SpecMod | 453c77c1fa51c220470e2aa4d92ec432360bfc9f | [
"MIT"
] | null | null | null | specmod/Models.py | sgjholt/SpecMod | 453c77c1fa51c220470e2aa4d92ec432360bfc9f | [
"MIT"
] | null | null | null | # MODELS contains a set of functions for minimisation to seismic spectra.
# It can be modified as appropriate.
import numpy as np
from . import config as cfg
MODS = ["BRUNE", "BOATWRIGHT"]
# UTIL FUNCS
def which_model(mod):
if mod in MODS:
if mod == "BRUNE":
return BRUNE_MODEL
if mod =... | 25.352941 | 84 | 0.638631 |
import numpy as np
from . import config as cfg
MODS = ["BRUNE", "BOATWRIGHT"]
def which_model(mod):
if mod in MODS:
if mod == "BRUNE":
return BRUNE_MODEL
if mod == "BOATWRIGHT":
return BOATWRIGHT_MODEL
else:
raise ValueError(f"Model {mod} not available. Choos... | true | true |
f7504e9173bf54d68131232b6373d719b11b9190 | 57,554 | py | Python | pandas/tests/frame/methods/test_replace.py | AdrianMastronardi/pandas | 67045903306ac4a1cab108177e92df30d99912b4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-01T08:44:40.000Z | 2019-11-01T08:44:40.000Z | pandas/tests/frame/methods/test_replace.py | AdrianMastronardi/pandas | 67045903306ac4a1cab108177e92df30d99912b4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/frame/methods/test_replace.py | AdrianMastronardi/pandas | 67045903306ac4a1cab108177e92df30d99912b4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from datetime import datetime
import re
import numpy as np
import pytest
from pandas.compat import np_version_under1p20
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
@pytest.fixture
de... | 36.658599 | 88 | 0.501807 | from __future__ import annotations
from datetime import datetime
import re
import numpy as np
import pytest
from pandas.compat import np_version_under1p20
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
@pytest.fixture
de... | true | true |
f7504f08335001d04ed002f847caa49557648f95 | 259 | py | Python | Python/Tests/TestData/DjangoProjectWithSubDirectory/project/manage.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | Python/Tests/TestData/DjangoProjectWithSubDirectory/project/manage.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | 9 | 2020-06-05T19:18:35.000Z | 2022-03-11T23:30:50.000Z | Python/Tests/TestData/DjangoProjectWithSubDirectory/project/manage.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.545455 | 71 | 0.741313 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f7505020bea473303d8e9042ee4a28be790a4646 | 151 | py | Python | Capitulo 1/32 - conjunto.py | mmmacedo/python | 2e7d99021342a5c7c31fe644ff194b6a8fa88a88 | [
"MIT"
] | null | null | null | Capitulo 1/32 - conjunto.py | mmmacedo/python | 2e7d99021342a5c7c31fe644ff194b6a8fa88a88 | [
"MIT"
] | null | null | null | Capitulo 1/32 - conjunto.py | mmmacedo/python | 2e7d99021342a5c7c31fe644ff194b6a8fa88a88 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
conjunto = {"alface", "tomate", "cenoura", "beterraba", "tomate"}
print ("Atente que o tomate não é repetido:", conjunto) | 30.2 | 66 | 0.615894 |
conjunto = {"alface", "tomate", "cenoura", "beterraba", "tomate"}
print ("Atente que o tomate não é repetido:", conjunto) | true | true |
f75050affbc544705ad40228ac7c585ba6cd1386 | 467 | py | Python | top/api/rest/FenxiaoProductcatUpdateRequest.py | forestsheep/middleman | 34d54f9ffd9d7bcd775a8dcce4f00dd6c5bb1acd | [
"MIT"
] | null | null | null | top/api/rest/FenxiaoProductcatUpdateRequest.py | forestsheep/middleman | 34d54f9ffd9d7bcd775a8dcce4f00dd6c5bb1acd | [
"MIT"
] | null | null | null | top/api/rest/FenxiaoProductcatUpdateRequest.py | forestsheep/middleman | 34d54f9ffd9d7bcd775a8dcce4f00dd6c5bb1acd | [
"MIT"
] | null | null | null | '''
Created by auto_sdk on 2016.04.13
'''
from top.api.base import RestApi
class FenxiaoProductcatUpdateRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.agent_cost_percent = None
self.dealer_cost_percent = None
self.name = None
self.product_lin... | 27.470588 | 55 | 0.768737 | from top.api.base import RestApi
class FenxiaoProductcatUpdateRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.agent_cost_percent = None
self.dealer_cost_percent = None
self.name = None
self.product_line_id = None
self.retail_high_percent = N... | true | true |
f75050b90de6118a343c52b9275f45ad4367cd56 | 3,418 | py | Python | Ago-Dic-2019/Luis Llanes/PracticaBaseDatos/GuardarUsuarios.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2019/Luis Llanes/PracticaBaseDatos/GuardarUsuarios.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2019/Luis Llanes/PracticaBaseDatos/GuardarUsuarios.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | import requests
import sqlite3
import pprint
def Crear_tabla():
try:
conexion = sqlite3.connect('usuarios.db')
cursor = conexion.cursor()
print('Conectado a SQLite')
query = '''CREATE TABLE IF NOT EXISTS usuarios (
id INTEGER PRIMARY KEY,
nam... | 29.213675 | 301 | 0.504389 | import requests
import sqlite3
import pprint
def Crear_tabla():
try:
conexion = sqlite3.connect('usuarios.db')
cursor = conexion.cursor()
print('Conectado a SQLite')
query = '''CREATE TABLE IF NOT EXISTS usuarios (
id INTEGER PRIMARY KEY,
nam... | true | true |
f75050ec54b602d66794ab3767fa19a55b20e7a8 | 15,237 | py | Python | selfdrive/car/hyundai/navicontrol.py | chanhojung/OPKR_0812_Hoya | bb14709e897340af81c364256aefbc6940d5ac27 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/navicontrol.py | chanhojung/OPKR_0812_Hoya | bb14709e897340af81c364256aefbc6940d5ac27 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/navicontrol.py | chanhojung/OPKR_0812_Hoya | bb14709e897340af81c364256aefbc6940d5ac27 | [
"MIT"
] | null | null | null | # created by atom
import math
import numpy as np
from selfdrive.config import Conversions as CV
from selfdrive.car.hyundai.values import Buttons
from common.numpy_fast import clip, interp
from cereal import log
import cereal.messaging as messaging
from common.params import Params
import common.log as trace1
import co... | 42.207756 | 170 | 0.679071 |
import math
import numpy as np
from selfdrive.config import Conversions as CV
from selfdrive.car.hyundai.values import Buttons
from common.numpy_fast import clip, interp
from cereal import log
import cereal.messaging as messaging
from common.params import Params
import common.log as trace1
import common.MoveAvg as m... | true | true |
f75051dd5917f65d445e29bca93cf6d754049a7a | 9,995 | py | Python | modules/pymol/wizard/density.py | markdoerr/pymol-open-source | b891b59ffaea812600648aa131ea2dbecd59a199 | [
"CNRI-Python"
] | null | null | null | modules/pymol/wizard/density.py | markdoerr/pymol-open-source | b891b59ffaea812600648aa131ea2dbecd59a199 | [
"CNRI-Python"
] | null | null | null | modules/pymol/wizard/density.py | markdoerr/pymol-open-source | b891b59ffaea812600648aa131ea2dbecd59a199 | [
"CNRI-Python"
] | null | null | null |
from __future__ import print_function
from pymol.wizard import Wizard
from pymol import cmd
import pymol
import copy
default_map = [ '', '', '']
default_level = [ 1.0, 3.0, -3.0]
default_radius = 8.0
default_track = 0
class Density(Wizard):
def __init__(self,_self=cmd):
self.cmd = _self
self.c... | 38.442308 | 107 | 0.466833 |
from __future__ import print_function
from pymol.wizard import Wizard
from pymol import cmd
import pymol
import copy
default_map = [ '', '', '']
default_level = [ 1.0, 3.0, -3.0]
default_radius = 8.0
default_track = 0
class Density(Wizard):
def __init__(self,_self=cmd):
self.cmd = _self
self.c... | true | true |
f7505224b0cdab689c5685c787d004d5401af772 | 1,564 | py | Python | main.py | Tomut0/AltoCoinsEditor | f383321f16dd59b209fddd418ccf231cd580981d | [
"MIT"
] | 1 | 2021-07-30T22:47:55.000Z | 2021-07-30T22:47:55.000Z | main.py | Tomut0/AltoCoinsEditor | f383321f16dd59b209fddd418ccf231cd580981d | [
"MIT"
] | null | null | null | main.py | Tomut0/AltoCoinsEditor | f383321f16dd59b209fddd418ccf231cd580981d | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import messagebox
from winreg import *
TITLE = "Alto's editor"
RESOLUTION = "200x50"
PATH = r"Software\Team Alto\The Alto Collection"
def get_coins():
key = OpenKey(HKEY_CURRENT_USER, PATH)
for i in range(0, QueryInfoKey(key)[1]):
entry = EnumValue(key, i)
i... | 26.508475 | 88 | 0.672634 | from tkinter import *
from tkinter import messagebox
from winreg import *
TITLE = "Alto's editor"
RESOLUTION = "200x50"
PATH = r"Software\Team Alto\The Alto Collection"
def get_coins():
key = OpenKey(HKEY_CURRENT_USER, PATH)
for i in range(0, QueryInfoKey(key)[1]):
entry = EnumValue(key, i)
i... | true | true |
f7505310120c542afb8fe454135d42f329ddc0c8 | 2,172 | py | Python | parser.py | wang1ang/slide-transition-detector | 180673fe8f864afb514859558a951c57021dc757 | [
"MIT"
] | 4 | 2017-03-17T02:01:37.000Z | 2017-07-05T00:46:12.000Z | parser.py | wang1ang/slide-transition-detector | 180673fe8f864afb514859558a951c57021dc757 | [
"MIT"
] | null | null | null | parser.py | wang1ang/slide-transition-detector | 180673fe8f864afb514859558a951c57021dc757 | [
"MIT"
] | 2 | 2020-09-12T09:41:21.000Z | 2021-12-07T16:43:00.000Z | import mediaoutput
import argparse
import cv2
import os
from slides import SlideDataHelper
class SlideParser(object):
"""
Reverses the effect of SlideSorter. Basically takes the timetable
and the unique set of slides and turns them back into slides with
their name representing their timestamp. (Possi... | 39.490909 | 112 | 0.656077 | import mediaoutput
import argparse
import cv2
import os
from slides import SlideDataHelper
class SlideParser(object):
def __init__(self, slides_dir, timetable_path, output_dir, file_format):
self.timetable_path = timetable_path
self.slides = SlideDataHelper(slides_dir).get_slides()
self.o... | true | true |
f7505327bb34ca8d06e55a4d5abce887228c9c2f | 558 | py | Python | src/CSVTest.py | cadibemma/Calculator | d7d10f19b7c24dcaeb12fe2cf4914d31fe3b8d79 | [
"MIT"
] | null | null | null | src/CSVTest.py | cadibemma/Calculator | d7d10f19b7c24dcaeb12fe2cf4914d31fe3b8d79 | [
"MIT"
] | null | null | null | src/CSVTest.py | cadibemma/Calculator | d7d10f19b7c24dcaeb12fe2cf4914d31fe3b8d79 | [
"MIT"
] | null | null | null | import unittest
from CSVReader import CSVReader, class_factory
class MyTestCase(unittest.TestCase):
def setUp(self):
self.csv_reader = CSVReader('/src/Unit Test Addition.csv')
def test_return_data_as_object(self):
num = self.csv_reader.return_data_as_object('number')
self.ass... | 27.9 | 69 | 0.691756 | import unittest
from CSVReader import CSVReader, class_factory
class MyTestCase(unittest.TestCase):
def setUp(self):
self.csv_reader = CSVReader('/src/Unit Test Addition.csv')
def test_return_data_as_object(self):
num = self.csv_reader.return_data_as_object('number')
self.ass... | true | true |
f75054d7f5825d990ec52bcd34027884dd493564 | 1,220 | py | Python | ucloud/services/stepflow/schemas/models.py | wangrzneu/ucloud-sdk-python3 | 5115bdb754da8d277f6c1513d0ef9cf9a5fe184d | [
"Apache-2.0"
] | 37 | 2019-06-19T09:41:34.000Z | 2022-02-18T08:06:00.000Z | ucloud/services/stepflow/schemas/models.py | wangrzneu/ucloud-sdk-python3 | 5115bdb754da8d277f6c1513d0ef9cf9a5fe184d | [
"Apache-2.0"
] | 90 | 2019-08-09T09:27:33.000Z | 2022-03-30T15:54:55.000Z | ucloud/services/stepflow/schemas/models.py | wangrzneu/ucloud-sdk-python3 | 5115bdb754da8d277f6c1513d0ef9cf9a5fe184d | [
"Apache-2.0"
] | 19 | 2019-06-13T02:46:01.000Z | 2021-11-01T07:22:18.000Z | """ Code is generated by ucloud-model, DO NOT EDIT IT. """
from ucloud.core.typesystem import schema, fields
class ParamSchema(schema.ResponseSchema):
"""Param - 工作流参数"""
fields = {
"Name": fields.Str(required=False, load_from="Name"),
"Type": fields.Str(required=False, load_from="... | 32.105263 | 74 | 0.62459 |
from ucloud.core.typesystem import schema, fields
class ParamSchema(schema.ResponseSchema):
fields = {
"Name": fields.Str(required=False, load_from="Name"),
"Type": fields.Str(required=False, load_from="Type"),
"Value": fields.Str(required=False, load_from="Value"),
}
... | true | true |
f7505598be28e2bfa98269c17cfab2f263a6dfca | 2,026 | py | Python | tests/lib/test_row_handling.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 13 | 2018-09-28T14:02:59.000Z | 2021-12-07T21:31:54.000Z | tests/lib/test_row_handling.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 1 | 2018-10-01T17:49:05.000Z | 2018-10-09T01:10:56.000Z | tests/lib/test_row_handling.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 1 | 2021-02-08T18:32:16.000Z | 2021-02-08T18:32:16.000Z | """Tests for methods in row_handling.py."""
from claims_to_quality.lib.teradata_methods import row_handling
import mock
from tests.assets import test_helpers
def test_convert_list_of_lists_to_teradata_rows():
"""Test that lists of lists can be converted to Teradata row objects."""
data = [('value1', 2, 3), ... | 32.15873 | 86 | 0.670286 | from claims_to_quality.lib.teradata_methods import row_handling
import mock
from tests.assets import test_helpers
def test_convert_list_of_lists_to_teradata_rows():
data = [('value1', 2, 3), ('value2', 5, 6)]
columns = ['str_col', 'int_col_1', 'int_col_2']
output = row_handling.convert_list_of_lists_to... | true | true |
f75056d26c47b218bcc4b5e3e78aa69d2907469f | 2,454 | py | Python | test/svm_test.py | egonina/svm | 397f6fa8d29e8299478586e88864cae095fb08c1 | [
"BSD-3-Clause"
] | 1 | 2019-04-07T05:13:32.000Z | 2019-04-07T05:13:32.000Z | test/svm_test.py | egonina/svm | 397f6fa8d29e8299478586e88864cae095fb08c1 | [
"BSD-3-Clause"
] | null | null | null | test/svm_test.py | egonina/svm | 397f6fa8d29e8299478586e88864cae095fb08c1 | [
"BSD-3-Clause"
] | null | null | null | import unittest2 as unittest
import copy
import numpy as np
from svm_specializer.svm import *
class BasicTests(unittest.TestCase):
def test_init(self):
svm = SVM()
self.assertIsNotNone(svm)
class SyntheticDataTests(unittest.TestCase):
def read_data(self, in_file_name):
feats = open(in... | 30.675 | 89 | 0.58476 | import unittest2 as unittest
import copy
import numpy as np
from svm_specializer.svm import *
class BasicTests(unittest.TestCase):
def test_init(self):
svm = SVM()
self.assertIsNotNone(svm)
class SyntheticDataTests(unittest.TestCase):
def read_data(self, in_file_name):
feats = open(in... | true | true |
f750573a9c1129adafa58973bd3d7d395bd8781e | 3,163 | py | Python | circulo/utils/downloader.py | Lab41PaulM/Circulo | 8a15e94cf4434b6945d41709bb33a5d25b1963d5 | [
"Apache-2.0"
] | 81 | 2015-01-06T09:10:23.000Z | 2021-04-20T02:07:07.000Z | circulo/utils/downloader.py | Lab41PaulM/Circulo | 8a15e94cf4434b6945d41709bb33a5d25b1963d5 | [
"Apache-2.0"
] | 17 | 2015-01-02T21:27:35.000Z | 2018-12-12T17:03:49.000Z | circulo/utils/downloader.py | Lab41PaulM/Circulo | 8a15e94cf4434b6945d41709bb33a5d25b1963d5 | [
"Apache-2.0"
] | 44 | 2015-02-17T14:58:10.000Z | 2021-04-02T10:47:14.000Z | import urllib.request
import os
import zipfile
import gzip
import sys
import igraph as ig
from collections import defaultdict
def download_with_notes(url, filename, data_dir, progressbar=True):
"""
Uses urllib to download data from URL. Saves the results in
data_dir/FILENAME. Provides basic logging to stdo... | 28.754545 | 117 | 0.620297 | import urllib.request
import os
import zipfile
import gzip
import sys
import igraph as ig
from collections import defaultdict
def download_with_notes(url, filename, data_dir, progressbar=True):
print("Downloading data from " + url + ".....")
try:
if progressbar:
urllib.request.urlretrieve(u... | true | true |
f75057eb6a7951d5560922034517bec7d95f92a2 | 8,699 | py | Python | deep_rl/agent/PPO_recurrent_agent_recurrence.py | runxuanjiang/DeepRL | f5c47c52d4db50577fbada17b09d739da3da67cc | [
"MIT"
] | null | null | null | deep_rl/agent/PPO_recurrent_agent_recurrence.py | runxuanjiang/DeepRL | f5c47c52d4db50577fbada17b09d739da3da67cc | [
"MIT"
] | null | null | null | deep_rl/agent/PPO_recurrent_agent_recurrence.py | runxuanjiang/DeepRL | f5c47c52d4db50577fbada17b09d739da3da67cc | [
"MIT"
] | null | null | null | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 42.642157 | 130 | 0.546959 | true | true | |
f75057fa03166941a9f2eb14496d7cfd165fdbc7 | 960 | py | Python | mixnmatchttp/cache/exc.py | aayla-secura/simple_CORS_https_server | e32e1c0ce44f3b5a5e5dc830364eddb0b7127040 | [
"MIT"
] | 3 | 2019-03-28T04:17:17.000Z | 2021-08-02T20:15:17.000Z | mixnmatchttp/cache/exc.py | aayla-secura/simple_CORS_https_server | e32e1c0ce44f3b5a5e5dc830364eddb0b7127040 | [
"MIT"
] | 1 | 2020-07-02T20:48:18.000Z | 2020-07-07T19:09:24.000Z | mixnmatchttp/cache/exc.py | aayla-secura/simple_CORS_https_server | e32e1c0ce44f3b5a5e5dc830364eddb0b7127040 | [
"MIT"
] | 2 | 2020-05-31T11:24:10.000Z | 2021-08-02T20:20:32.000Z | from .._py2 import *
class CacheError(Exception):
'''Base class for exceptions related to the cache'''
pass
class PageNotCachedError(CacheError):
'''Exception raised when a non-existent page is requested'''
def __init__(self):
super().__init__('This page has not been cached yet.')
class Page... | 29.090909 | 64 | 0.672917 | from .._py2 import *
class CacheError(Exception):
pass
class PageNotCachedError(CacheError):
def __init__(self):
super().__init__('This page has not been cached yet.')
class PageClearedError(CacheError):
def __init__(self):
super().__init__('This page has been cleared.')
class CacheMem... | true | true |
f75059fd7c735b2dad5082d0c343fbe756680c7c | 6,895 | py | Python | tests/travis_test.py | icmaple931/facenet-pytorch | b2fd689b825e11b0636884fc69b4cf630c7e6c80 | [
"MIT"
] | 2,896 | 2019-05-25T01:44:41.000Z | 2022-03-31T03:54:17.000Z | tests/travis_test.py | victorgirleanu/facenet-pytorch | 555aa4bec20ca3e7c2ead14e7e39d5bbce203e4b | [
"MIT"
] | 170 | 2019-05-31T07:25:39.000Z | 2022-03-27T13:46:23.000Z | tests/travis_test.py | victorgirleanu/facenet-pytorch | 555aa4bec20ca3e7c2ead14e7e39d5bbce203e4b | [
"MIT"
] | 683 | 2019-05-25T01:45:52.000Z | 2022-03-30T10:06:20.000Z | """
The following code is intended to be run only by travis for continuius intengration and testing
purposes. For implementation examples see notebooks in the examples folder.
"""
from PIL import Image, ImageDraw
import torch
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
import n... | 29.848485 | 118 | 0.673096 |
from PIL import Image, ImageDraw
import torch
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
import numpy as np
import pandas as pd
from time import time
import sys, os
import glob
from models.mtcnn import MTCNN, fixed_image_standardization
from models.inception_resnet_v1 import ... | true | true |
f7505c836a06f7c6f0e5d2adb103589342e19358 | 412 | py | Python | programacion_orientada_a_objetos/main.py | JPGarzonE/curso-de-python | 37acfebffa3f6944ee2aa88c64567efe1471f968 | [
"MIT"
] | null | null | null | programacion_orientada_a_objetos/main.py | JPGarzonE/curso-de-python | 37acfebffa3f6944ee2aa88c64567efe1471f968 | [
"MIT"
] | 1 | 2020-01-26T18:51:08.000Z | 2020-01-26T18:51:08.000Z | programacion_orientada_a_objetos/main.py | JPGarzonE/curso-de-python | 37acfebffa3f6944ee2aa88c64567efe1471f968 | [
"MIT"
] | null | null | null | from lamp import Lamp
def run():
lamp = Lamp(is_turned_on=False)
while True:
command = str( input('''
¿Qué deseas hacer?
[p]render
[a]pagar
[s]alir
'''))
if command == 'p':
lamp.turn_on()
elif command == 'a':
... | 16.48 | 35 | 0.436893 | from lamp import Lamp
def run():
lamp = Lamp(is_turned_on=False)
while True:
command = str( input('''
¿Qué deseas hacer?
[p]render
[a]pagar
[s]alir
'''))
if command == 'p':
lamp.turn_on()
elif command == 'a':
... | true | true |
f7505d1b79d2a9cd8601e32e758458b01b198dd8 | 5,863 | py | Python | net_performance_comparison.py | SandhyaaGopchandani/PythonNetworkLibsComparion | 72db0cabecd0a9764663a044b19ef4dde843c402 | [
"MIT"
] | 1 | 2019-05-27T07:44:23.000Z | 2019-05-27T07:44:23.000Z | net_performance_comparison.py | SandhyaaGopchandani/PythonNetworkLibsComparion | 72db0cabecd0a9764663a044b19ef4dde843c402 | [
"MIT"
] | null | null | null | net_performance_comparison.py | SandhyaaGopchandani/PythonNetworkLibsComparion | 72db0cabecd0a9764663a044b19ef4dde843c402 | [
"MIT"
] | null | null | null | import itertools
import numpy as np
from timeit import default_timer as timer
from graph_tool.all import *
import pickle
import networkx as nx
import matplotlib as mpl
#mpl.use('TkAgg')
import matplotlib.pyplot as plt
from igraph import *
def nodes_edges(num_nodes):
""" this function takes number of nodes and ret... | 38.827815 | 127 | 0.640287 | import itertools
import numpy as np
from timeit import default_timer as timer
from graph_tool.all import *
import pickle
import networkx as nx
import matplotlib as mpl
import matplotlib.pyplot as plt
from igraph import *
def nodes_edges(num_nodes):
nodes = list(range(num_nodes))
edges = list(itertools.combin... | true | true |
f7505d8d55a4ceb60102526dcc24a36692816dae | 1,381 | py | Python | setup.py | soukutsu/egara | 220963d4790f1c8eb01d1e6f5e3e037474aa1f05 | [
"BSD-3-Clause"
] | null | null | null | setup.py | soukutsu/egara | 220963d4790f1c8eb01d1e6f5e3e037474aa1f05 | [
"BSD-3-Clause"
] | 71 | 2020-12-04T15:01:40.000Z | 2021-09-01T10:35:12.000Z | setup.py | radowit/egara | 220963d4790f1c8eb01d1e6f5e3e037474aa1f05 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [ ]
setup_requirements = ['pytest-runner', ]
test_requiremen... | 28.183673 | 57 | 0.645909 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [ ]
setup_requirements = ['pytest-runner', ]
test_requirements = ['pytest>=3', ]
setup(
author="Rado... | true | true |
f7505d8e04f6c0d062aa7ce7e7e3aae484eebdf9 | 2,154 | py | Python | pychron/envisage/tasks/base_editor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/envisage/tasks/base_editor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/envisage/tasks/base_editor.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | 29.108108 | 81 | 0.506964 |
from pyface.tasks.traits_editor import TraitsEditor
from traits.api import Bool
from pychron.loggable import Loggable
def grouped_name(names, delimiter="-"):
s = names[0]
e = names[-1]
if s != e:
if all([delimiter in x for x in names]):
prev = None
for x... | true | true |
f7505dbd2cca9f47575876f31190155a80c55d15 | 977 | py | Python | packages/fetchai/skills/fetch_beacon/__init__.py | fetchai/agents-aea | 5e5850a3b38e678d31a688c9edad3e0a124678d5 | [
"Apache-2.0"
] | 126 | 2019-09-07T09:32:44.000Z | 2022-03-29T14:28:41.000Z | packages/fetchai/skills/fetch_beacon/__init__.py | fetchai/agents-aea | 5e5850a3b38e678d31a688c9edad3e0a124678d5 | [
"Apache-2.0"
] | 1,814 | 2019-08-24T10:08:07.000Z | 2022-03-31T14:28:36.000Z | packages/fetchai/skills/fetch_beacon/__init__.py | fetchai/agents-aea | 5e5850a3b38e678d31a688c9edad3e0a124678d5 | [
"Apache-2.0"
] | 46 | 2019-09-03T22:13:58.000Z | 2022-03-22T01:25:16.000Z | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 37.576923 | 80 | 0.614125 |
from aea.configurations.base import PublicId
PUBLIC_ID = PublicId.from_str("fetchai/fetch_beacon:0.12.0")
| true | true |
f7505e39a3d3961609dd28306e84b7c3ca78e1f3 | 844 | py | Python | Curso de Python 3 - Mundo 1 - Fundamentos/#065.py | bitwoman/curso-em-video-python | bb097eb925f271c34e97e20902e6b18cca62c275 | [
"MIT"
] | null | null | null | Curso de Python 3 - Mundo 1 - Fundamentos/#065.py | bitwoman/curso-em-video-python | bb097eb925f271c34e97e20902e6b18cca62c275 | [
"MIT"
] | null | null | null | Curso de Python 3 - Mundo 1 - Fundamentos/#065.py | bitwoman/curso-em-video-python | bb097eb925f271c34e97e20902e6b18cca62c275 | [
"MIT"
] | null | null | null | # Exercício Python 065: Crie um programa que leia vários números inteiros pelo teclado.
# No final da execução, mostre a média entre todos os valores e qual foi o maior e o menor valores lidos.
# O programa deve perguntar ao usuário se ele quer ou não continuar a digitar valores.
sum = average = bigger = smaller = co... | 32.461538 | 106 | 0.674171 |
sum = average = bigger = smaller = count = 0
exit = ''
while exit != 'S':
number = int(input('Enter a number: '))
sum += number
count +=1
if count == 1:
bigger = smaller = number
else:
if number > bigger:
bigger = number
if number < smaller:
smaller = number
exit = str(input(... | true | true |
f7505eca6cdd26c496a701b3576c80c528b2b339 | 28,210 | py | Python | miprometheus/workers/worker.py | tsjayram/mi-prometheus | cf163d9e246c3ae3c100045e58924148b2f81c39 | [
"Apache-2.0"
] | null | null | null | miprometheus/workers/worker.py | tsjayram/mi-prometheus | cf163d9e246c3ae3c100045e58924148b2f81c39 | [
"Apache-2.0"
] | null | null | null | miprometheus/workers/worker.py | tsjayram/mi-prometheus | cf163d9e246c3ae3c100045e58924148b2f81c39 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) IBM Corporation 2018
#
# 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
#
# U... | 38.276798 | 121 | 0.567387 |
__author__ = "Vincent Marois, Tomasz Kornuta, Ryan L. McAvoy"
import os
import yaml
import torch
import logging
import logging.config
import argparse
import numpy as np
from random import randrange
from abc import abstractmethod
from torch.utils.data import DataLoader
from miprometheus.utils.sampler... | true | true |
f7505ee2d7d109ed2d104233afffde3dbf301ed8 | 18,597 | py | Python | yacon/models/hierarchy.py | cltrudeau/django-yacon | d462c88cf98bf8eef50a0696b265fa28dfdb40eb | [
"MIT"
] | null | null | null | yacon/models/hierarchy.py | cltrudeau/django-yacon | d462c88cf98bf8eef50a0696b265fa28dfdb40eb | [
"MIT"
] | 9 | 2020-02-11T23:38:20.000Z | 2022-03-11T23:16:29.000Z | yacon/models/hierarchy.py | cltrudeau/django-yacon | d462c88cf98bf8eef50a0696b265fa28dfdb40eb | [
"MIT"
] | null | null | null | # yacon.models.hierarchy.py
import re, logging
from django.db import models
from django.template.defaultfilters import slugify
from treebeard.mp_tree import MP_Node
from yacon.models.common import Language, TimeTrackedModel, NodePermissionTypes
from yacon.models.pages import Page, MetaPage
from yacon.definitions imp... | 35.422857 | 80 | 0.618272 |
import re, logging
from django.db import models
from django.template.defaultfilters import slugify
from treebeard.mp_tree import MP_Node
from yacon.models.common import Language, TimeTrackedModel, NodePermissionTypes
from yacon.models.pages import Page, MetaPage
from yacon.definitions import SLUG_LENGTH
logger = l... | true | true |
f75060c4aba0d4816fbf6d2075618ee1d009febb | 383 | py | Python | webapp/migrations/0005_raffle_active.py | anselm92/hex1e | 14c880cdf8951fa62c03f8604054c0a044397431 | [
"Apache-2.0"
] | null | null | null | webapp/migrations/0005_raffle_active.py | anselm92/hex1e | 14c880cdf8951fa62c03f8604054c0a044397431 | [
"Apache-2.0"
] | 6 | 2021-03-30T14:00:12.000Z | 2022-02-04T21:32:23.000Z | webapp/migrations/0005_raffle_active.py | anselm92/hex1e | 14c880cdf8951fa62c03f8604054c0a044397431 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0 on 2020-06-12 11:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0004_auto_20200611_1928'),
]
operations = [
migrations.AddField(
model_name='raffle',
name='active',
... | 20.157895 | 52 | 0.597911 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0004_auto_20200611_1928'),
]
operations = [
migrations.AddField(
model_name='raffle',
name='active',
field=models.BooleanField(default=True),... | true | true |
f750611568fec2d1d741d731e1616d5c1cafa9e7 | 4,180 | py | Python | instances/optimization/20210421-2109/inst-20210421-2109-c70-pas14000000000000001e.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/optimization/20210421-2109/inst-20210421-2109-c70-pas14000000000000001e.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/optimization/20210421-2109/inst-20210421-2109-c70-pas14000000000000001e.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PERIODS
"""
numPeriods = 60
"""
STOPS
"""
numStations = 6
station_names = (
"Hamburg Hbf", # 0
"Landwehr", # 1
"Hasselbrook", # 2
"Wansbeker Chaussee*", # 3
"Friedrichsberg*", # 4
"Barmbek*", # 5
)
numStops = 12
stops_position = (
(0, 0), # Stop 0
(2, 0), # Stop 1
(3, 0), # Stop 2
(4, 0), # ... | 12.403561 | 108 | 0.444976 |
numPeriods = 60
numStations = 6
station_names = (
"Hamburg Hbf",
"Landwehr",
"Hasselbrook",
"Wansbeker Chaussee*",
"Friedrichsberg*",
"Barmbek*",
)
numStops = 12
stops_position = (
(0, 0),
(2, 0),
(3, 0),
(4, 0),
(5, 0),
(7, 0),
(7, 1),
(15, 1),
(13, 1),
(12, 1),
(11, 1),
(10,... | true | true |
f75061eb287bffbabae10785731e7e7abbba670e | 9,104 | py | Python | python/fate_arch/federation/pulsar/_mq_channel.py | QuantumA/FATE | 89a3dd593252128c1bf86fb1014b25a629bdb31a | [
"Apache-2.0"
] | 1 | 2022-02-07T06:23:15.000Z | 2022-02-07T06:23:15.000Z | python/fate_arch/federation/pulsar/_mq_channel.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 11 | 2020-10-09T09:53:50.000Z | 2021-12-06T16:14:51.000Z | python/fate_arch/federation/pulsar/_mq_channel.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | null | null | null | ########################################################
# Copyright 2019-2021 program was created VMware, Inc. #
# SPDX-License-Identifier: Apache-2.0 #
########################################################
import time
import pulsar
from fate_arch.common import log
LOGGER = log.getLogger()
CHANN... | 33.843866 | 79 | 0.574802 | out is not None:
LOGGER.debug(
f"receive timeout millis {receive_timeout}")
message = self._consumer_receive.receive(
timeout_millis=receive_timeout)
return message
except Exception:
self._consumer_receive.seek(pulsar.Messag... | true | true |
f750648a24e2d437d175e6598497087a9c6d1645 | 6,829 | py | Python | c7n/resources/batch.py | noelbundick/cloud-custodian | 868d15347aaa1e116a2bc927c9a545bf8dd603a3 | [
"Apache-2.0"
] | null | null | null | c7n/resources/batch.py | noelbundick/cloud-custodian | 868d15347aaa1e116a2bc927c9a545bf8dd603a3 | [
"Apache-2.0"
] | null | null | null | c7n/resources/batch.py | noelbundick/cloud-custodian | 868d15347aaa1e116a2bc927c9a545bf8dd603a3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2018 Capital One Services, 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 ... | 33.640394 | 82 | 0.644018 |
from __future__ import absolute_import, division, print_function, unicode_literals
from c7n.actions import BaseAction
from c7n.filters.vpc import SecurityGroupFilter, SubnetFilter
from c7n.manager import resources
from c7n.query import QueryResourceManager
from c7n.utils import local_session, type_schema... | true | true |
f750652c0621fec3ab272d8250b0764533baa178 | 898 | py | Python | ordenes/migrations/0002_auto_20200305_0056.py | Omar-Gonzalez/echangarro-demo | a7a970d9793c5e467ca117e9f515a9da423fac14 | [
"MIT"
] | null | null | null | ordenes/migrations/0002_auto_20200305_0056.py | Omar-Gonzalez/echangarro-demo | a7a970d9793c5e467ca117e9f515a9da423fac14 | [
"MIT"
] | 9 | 2021-03-19T11:25:28.000Z | 2022-03-12T00:35:18.000Z | ordenes/migrations/0002_auto_20200305_0056.py | Omar-Gonzalez/echangarro-demo | a7a970d9793c5e467ca117e9f515a9da423fac14 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2020-03-05 00:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ordenes', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='orden',
name='preferencia_de_pago',
... | 37.416667 | 263 | 0.609131 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ordenes', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='orden',
name='preferencia_de_pago',
field=models.CharField(choices=[('MERC... | true | true |
f7506566f4a087d234ab42c7f069fa5069a16f32 | 6,570 | py | Python | pooch/tests/test_processors.py | andersy005/pooch | e6814496fc0c338003779ef6772f17dc3ccff28f | [
"BSD-3-Clause"
] | null | null | null | pooch/tests/test_processors.py | andersy005/pooch | e6814496fc0c338003779ef6772f17dc3ccff28f | [
"BSD-3-Clause"
] | null | null | null | pooch/tests/test_processors.py | andersy005/pooch | e6814496fc0c338003779ef6772f17dc3ccff28f | [
"BSD-3-Clause"
] | null | null | null | """
Test the processor hooks
"""
from pathlib import Path
from tempfile import TemporaryDirectory
import warnings
import pytest
from .. import Pooch
from ..processors import Unzip, Untar, ExtractorProcessor, Decompress
from .utils import pooch_test_url, pooch_test_registry, check_tiny_data
REGISTRY = pooch_test_re... | 42.941176 | 85 | 0.638661 | from pathlib import Path
from tempfile import TemporaryDirectory
import warnings
import pytest
from .. import Pooch
from ..processors import Unzip, Untar, ExtractorProcessor, Decompress
from .utils import pooch_test_url, pooch_test_registry, check_tiny_data
REGISTRY = pooch_test_registry()
BASEURL = pooch_test_url... | true | true |
f7506675a49e429c4773567f37dc4f84e48ae446 | 4,511 | py | Python | varconlib/star/tests/test_star.py | DBerke/varconlib | 4771cf315c8fa76e1982612f3ac520c0cec098d8 | [
"MIT"
] | null | null | null | varconlib/star/tests/test_star.py | DBerke/varconlib | 4771cf315c8fa76e1982612f3ac520c0cec098d8 | [
"MIT"
] | null | null | null | varconlib/star/tests/test_star.py | DBerke/varconlib | 4771cf315c8fa76e1982612f3ac520c0cec098d8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 9 16:50:42 2019
@author: dberke
Tests for star.py.
"""
import datetime as dt
from pathlib import Path
import numpy as np
import pytest
import unyt as u
import varconlib as vcl
from varconlib.exceptions import StarDirectoryNotFoundError
from va... | 33.664179 | 79 | 0.584571 |
import datetime as dt
from pathlib import Path
import numpy as np
import pytest
import unyt as u
import varconlib as vcl
from varconlib.exceptions import StarDirectoryNotFoundError
from varconlib.star import Star
pytestmark = pytest.mark.filterwarnings(("ignore::DeprecationWarning"))
base_test_dir = vcl.data_di... | true | true |
f75066d78403bd23ceb7beb88241b449d332a586 | 3,982 | py | Python | src/spaceone/inventory/model/networksecuritygroup/cloud_service.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 1 | 2020-12-08T11:59:54.000Z | 2020-12-08T11:59:54.000Z | src/spaceone/inventory/model/networksecuritygroup/cloud_service.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 4 | 2021-01-26T10:43:37.000Z | 2021-12-17T10:13:33.000Z | src/spaceone/inventory/model/networksecuritygroup/cloud_service.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 2 | 2021-01-13T03:24:05.000Z | 2021-01-19T07:25:45.000Z | from schematics.types import ModelType, StringType, PolyModelType
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, DateTimeDyField, EnumDyField, \
ListDyField, SizeField, StateItemDyField
from spaceone.inventory.libs.schema.metadata.dynamic_layout import ItemDynamicLayout, TableDynami... | 46.847059 | 146 | 0.792567 | from schematics.types import ModelType, StringType, PolyModelType
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, DateTimeDyField, EnumDyField, \
ListDyField, SizeField, StateItemDyField
from spaceone.inventory.libs.schema.metadata.dynamic_layout import ItemDynamicLayout, TableDynami... | true | true |
f750677ab60df8e99602e3bde9624bea82be47d6 | 856 | py | Python | guillotina/tests/vocabularies/test_vocabularies.py | rboixaderg/guillotina | fcae65c2185222272f3b8fee4bc2754e81e0e983 | [
"BSD-2-Clause"
] | 173 | 2017-03-10T18:26:12.000Z | 2022-03-03T06:48:56.000Z | guillotina/tests/vocabularies/test_vocabularies.py | rboixaderg/guillotina | fcae65c2185222272f3b8fee4bc2754e81e0e983 | [
"BSD-2-Clause"
] | 921 | 2017-03-08T14:04:43.000Z | 2022-03-30T10:28:56.000Z | guillotina/tests/vocabularies/test_vocabularies.py | rboixaderg/guillotina | fcae65c2185222272f3b8fee4bc2754e81e0e983 | [
"BSD-2-Clause"
] | 60 | 2017-03-16T19:59:44.000Z | 2022-03-03T06:48:59.000Z | import pytest
pytestmark = pytest.mark.asyncio
@pytest.mark.app_settings({"applications": ["guillotina", "guillotina.contrib.vocabularies"]})
async def test_contrib_vocabulary(container_requester):
async with container_requester as requester:
response, _ = await requester("GET", "/db/guillotina/@vocabul... | 45.052632 | 94 | 0.670561 | import pytest
pytestmark = pytest.mark.asyncio
@pytest.mark.app_settings({"applications": ["guillotina", "guillotina.contrib.vocabularies"]})
async def test_contrib_vocabulary(container_requester):
async with container_requester as requester:
response, _ = await requester("GET", "/db/guillotina/@vocabul... | true | true |
f7506a205989ba40a3c2455e646febcc7eb0ade1 | 4,277 | py | Python | tests/snippets/dict.py | ZapAnton/RustPython | 61e752e2b014239865c74c6997429a80433ee38a | [
"MIT"
] | null | null | null | tests/snippets/dict.py | ZapAnton/RustPython | 61e752e2b014239865c74c6997429a80433ee38a | [
"MIT"
] | null | null | null | tests/snippets/dict.py | ZapAnton/RustPython | 61e752e2b014239865c74c6997429a80433ee38a | [
"MIT"
] | null | null | null | from testutils import assertRaises
assert dict(a=2, b=3) == {'a': 2, 'b': 3}
assert dict({'a': 2, 'b': 3}, b=4) == {'a': 2, 'b': 4}
assert dict([('a', 2), ('b', 3)]) == {'a': 2, 'b': 3}
assert {} == {}
assert not {'a': 2} == {}
assert not {} == {'a': 2}
assert not {'b': 2} == {'a': 2}
assert not {'a': 4} == {'a': 2}
... | 21.068966 | 93 | 0.525134 | from testutils import assertRaises
assert dict(a=2, b=3) == {'a': 2, 'b': 3}
assert dict({'a': 2, 'b': 3}, b=4) == {'a': 2, 'b': 4}
assert dict([('a', 2), ('b', 3)]) == {'a': 2, 'b': 3}
assert {} == {}
assert not {'a': 2} == {}
assert not {} == {'a': 2}
assert not {'b': 2} == {'a': 2}
assert not {'a': 4} == {'a': 2}
... | true | true |
f7506a86839260982fe119328c484113cc205d8c | 3,818 | py | Python | tools/gethostlatency.py | gtataranni/bcc | b090f5f9eee62796829184ec862e3378a3b7e425 | [
"Apache-2.0"
] | 58 | 2015-08-28T08:46:35.000Z | 2022-02-27T14:31:55.000Z | tools/gethostlatency.py | gtataranni/bcc | b090f5f9eee62796829184ec862e3378a3b7e425 | [
"Apache-2.0"
] | 1 | 2020-01-23T13:20:33.000Z | 2020-01-23T13:20:33.000Z | tools/gethostlatency.py | gtataranni/bcc | b090f5f9eee62796829184ec862e3378a3b7e425 | [
"Apache-2.0"
] | 12 | 2017-02-28T02:50:31.000Z | 2021-07-26T17:54:07.000Z | #!/usr/bin/python
#
# gethostlatency Show latency for getaddrinfo/gethostbyname[2] calls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# This can be useful for identifying DNS latency, by identifying which
# remote host name lookups were slow, and by how much.
#
# This uses dynamic tracing of user-level ... | 29.145038 | 78 | 0.65165 |
from __future__ import print_function
from bcc import BPF
from time import strftime
import argparse
examples = """examples:
./gethostlatency # time getaddrinfo/gethostbyname[2] calls
./gethostlatency -p 181 # only trace PID 181
"""
parser = argparse.ArgumentParser(
description... | true | true |
f7506b4a181dd822869a73476d2e4574e4e486d3 | 359 | py | Python | app_placas/views.py | naelallves/proj_sinal_transito | bc8b82c1809b8ff97996227bbefc07f42ea5f736 | [
"MIT"
] | null | null | null | app_placas/views.py | naelallves/proj_sinal_transito | bc8b82c1809b8ff97996227bbefc07f42ea5f736 | [
"MIT"
] | null | null | null | app_placas/views.py | naelallves/proj_sinal_transito | bc8b82c1809b8ff97996227bbefc07f42ea5f736 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from .models import Placa
def index(request):
data = dict()
data['regulamentacao'] = Placa.objects.filter(categoria='reg').order_by('pk')
data['advertencia'] = Placa.objects.filter(categoria='adv').order_by('pk')
return render(r... | 29.916667 | 81 | 0.729805 | from django.shortcuts import render
from django.http import HttpResponse
from .models import Placa
def index(request):
data = dict()
data['regulamentacao'] = Placa.objects.filter(categoria='reg').order_by('pk')
data['advertencia'] = Placa.objects.filter(categoria='adv').order_by('pk')
return render(r... | true | true |
f7506cd40f8537a9a6cdc85664d39ab30ef70fe0 | 15,365 | py | Python | qark/modules/findExtras.py | pragyan1994/qark | a38c0b95af04d4584557ad056d697a0e08018b55 | [
"Apache-2.0"
] | 1 | 2017-12-02T21:34:26.000Z | 2017-12-02T21:34:26.000Z | qark/modules/findExtras.py | pragyan1994/qark | a38c0b95af04d4584557ad056d697a0e08018b55 | [
"Apache-2.0"
] | null | null | null | qark/modules/findExtras.py | pragyan1994/qark | a38c0b95af04d4584557ad056d697a0e08018b55 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
'''Copyright 2015 LinkedIn Corp. 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 ... | 36.496437 | 161 | 0.692678 | from __future__ import absolute_import
import zipfile
import os
from genericpath import isdir
import subprocess
import logging
import shlex
import re
from xml.dom import minidom
from lib.plyj import parser as plyj
import lib.plyj.model as m
from modules import constantResolver
from modules import common
parser = ply... | true | true |
f7506d934c97fbf7854f29ceb4044f40628a1280 | 15,825 | py | Python | naomi/profile.py | kowo-zahl/Naomi | 476cfc42036a1ac88e33451431fc64d5ea1aa49a | [
"MIT"
] | null | null | null | naomi/profile.py | kowo-zahl/Naomi | 476cfc42036a1ac88e33451431fc64d5ea1aa49a | [
"MIT"
] | null | null | null | naomi/profile.py | kowo-zahl/Naomi | 476cfc42036a1ac88e33451431fc64d5ea1aa49a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
These functions "walk" the profile, and return either a boolean variable to
tell whether an option is configured or not, or the actual value
"""
import base64
import inspect
import logging
import hashlib
import os
import re
import shutil
import sys
import yaml
from cryptography.fernet import... | 33.598726 | 103 | 0.544455 |
import base64
import inspect
import logging
import hashlib
import os
import re
import shutil
import sys
import yaml
from cryptography.fernet import InvalidToken
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptog... | true | true |
f7506db0a1f28ef2ced9605fa76dc1dd7483e8db | 186 | py | Python | project_euler_48.py | andrazm123/Project-Euler | 260a46810bce73e1079c13518ae94732c8cb1acb | [
"MIT"
] | null | null | null | project_euler_48.py | andrazm123/Project-Euler | 260a46810bce73e1079c13518ae94732c8cb1acb | [
"MIT"
] | null | null | null | project_euler_48.py | andrazm123/Project-Euler | 260a46810bce73e1079c13518ae94732c8cb1acb | [
"MIT"
] | null | null | null | import sys
sys.setrecursionlimit(1500)
def vsota_potenc(n):
if n == 1:
return 1
else:
return n ** n + vsota_potenc(n - 1)
print(vsota_potenc(1000) % (10 ** 10)) | 18.6 | 43 | 0.596774 | import sys
sys.setrecursionlimit(1500)
def vsota_potenc(n):
if n == 1:
return 1
else:
return n ** n + vsota_potenc(n - 1)
print(vsota_potenc(1000) % (10 ** 10)) | true | true |
f7506f3a64a90a031cc20d680cf40b66a54da65a | 806 | py | Python | manage.py | SkillSmart/ConferenceManagementSystem | 43af08260f321d1d506755da5c1b6ce1cf95fc42 | [
"MIT"
] | null | null | null | manage.py | SkillSmart/ConferenceManagementSystem | 43af08260f321d1d506755da5c1b6ce1cf95fc42 | [
"MIT"
] | null | null | null | manage.py | SkillSmart/ConferenceManagementSystem | 43af08260f321d1d506755da5c1b6ce1cf95fc42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cdrc_cms.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... | 35.043478 | 77 | 0.64268 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cdrc_cms.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportError:
... | true | true |
f750724f1252c0781847c583bb51bf5813287c2a | 10,230 | py | Python | orc8r/gateway/python/magma/common/service.py | sarathbrp/magma | 2641929b1adbaaabf344b8f0e23fc442afcdae4a | [
"BSD-3-Clause"
] | null | null | null | orc8r/gateway/python/magma/common/service.py | sarathbrp/magma | 2641929b1adbaaabf344b8f0e23fc442afcdae4a | [
"BSD-3-Clause"
] | null | null | null | orc8r/gateway/python/magma/common/service.py | sarathbrp/magma | 2641929b1adbaaabf344b8f0e23fc442afcdae4a | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import asyncio
import loggi... | 31.284404 | 79 | 0.614467 |
import asyncio
import logging
import signal
import time
from concurrent import futures
import functools
import grpc
import os
import pkg_resources
from orc8r.protos.common_pb2 import LogLevel, Void
from orc8r.protos.metricsd_pb2 import MetricsContainer
from orc8r.protos.service303_pb2 import ServiceInfo, ReloadConfig... | true | true |
f750725964b62fec84bf81827fccf54ce76e00db | 1,806 | py | Python | electrum_gui/common/coin/loader.py | BixinKey/electrum | f5de4e74e313b9b569f13ba6ab9142a38bf095f2 | [
"MIT"
] | 12 | 2020-11-12T08:53:05.000Z | 2021-07-06T17:30:39.000Z | electrum_gui/common/coin/loader.py | liyanhrxy/electrum | 107608ef201ff1d20d2f6091c257b1ceff9b7362 | [
"MIT"
] | 209 | 2020-09-23T06:58:18.000Z | 2021-11-18T11:25:41.000Z | electrum_gui/common/coin/loader.py | liyanhrxy/electrum | 107608ef201ff1d20d2f6091c257b1ceff9b7362 | [
"MIT"
] | 19 | 2020-10-13T11:42:26.000Z | 2022-02-06T01:26:34.000Z | import enum
import functools
from typing import Dict, Type
from electrum_gui.common.basic import bip44
from electrum_gui.common.coin import data
from electrum_gui.common.conf import chains as chains_conf
from electrum_gui.common.secret import data as secret_data
CHAINS_DICT = {}
COINS_DICT = {}
def _replace_enum_fi... | 30.610169 | 77 | 0.63289 | import enum
import functools
from typing import Dict, Type
from electrum_gui.common.basic import bip44
from electrum_gui.common.coin import data
from electrum_gui.common.conf import chains as chains_conf
from electrum_gui.common.secret import data as secret_data
CHAINS_DICT = {}
COINS_DICT = {}
def _replace_enum_fi... | true | true |
f750735c35d6afcb8124c0dc5f9f64b1561f43d6 | 5,574 | py | Python | setup.py | jamesjnadeau/jupyterlab | 6d7cd3e4ba57e423f7af2900dff9cf69a3992ea3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jamesjnadeau/jupyterlab | 6d7cd3e4ba57e423f7af2900dff9cf69a3992ea3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jamesjnadeau/jupyterlab | 6d7cd3e4ba57e423f7af2900dff9cf69a3992ea3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from os.path import join as pjoin
import json
import os
import sys
# Our own imports
from jupyter_packaging import (
create_cmdclass, get_version,
command_for_func, combin... | 28.438776 | 80 | 0.643165 |
from os.path import join as pjoin
import json
import os
import sys
from jupyter_packaging import (
create_cmdclass, get_version,
command_for_func, combine_commands, install_npm, run,
skip_npm, which, log
)
from setuptools import setup, find_packages
from setuptools.command.develop import develop
H... | true | true |
f7507441ea1dd95e222c9a94851a3dccc1a630e6 | 912 | py | Python | main.py | degeri/DownloadHawk | 92f9617ad4256e47156897a1e4b99a57121ff768 | [
"BlueOak-1.0.0"
] | 1 | 2019-12-12T23:59:40.000Z | 2019-12-12T23:59:40.000Z | main.py | degeri/DownloadHawk | 92f9617ad4256e47156897a1e4b99a57121ff768 | [
"BlueOak-1.0.0"
] | 4 | 2019-11-22T09:13:12.000Z | 2021-06-29T16:35:24.000Z | main.py | degeri/DownloadHawk | 92f9617ad4256e47156897a1e4b99a57121ff768 | [
"BlueOak-1.0.0"
] | 1 | 2019-11-28T01:46:53.000Z | 2019-11-28T01:46:53.000Z | from functions import *
from log import *
from conf import *
wait_time=int(config['programconfig']['checktimemins'])*60
heart_time=int(config['programconfig']['heartbeatmins'])*60
websiteurl=config['urls']['siteurl']
ff_visible=0
if config['programconfig'].getboolean('hide_ff') == False:
ff_visible=1
count... | 26.823529 | 116 | 0.669956 | from functions import *
from log import *
from conf import *
wait_time=int(config['programconfig']['checktimemins'])*60
heart_time=int(config['programconfig']['heartbeatmins'])*60
websiteurl=config['urls']['siteurl']
ff_visible=0
if config['programconfig'].getboolean('hide_ff') == False:
ff_visible=1
count... | true | true |
f750745d1d1a4e85316d82c37c1fa83df68e42ed | 3,656 | py | Python | endaq/cloud/scripting.py | MideTechnology/endaq-python | a878efdd65f718c1324d92d467b19fd3b4142cd0 | [
"MIT"
] | 5 | 2021-12-02T04:41:52.000Z | 2022-02-01T19:44:41.000Z | endaq/cloud/scripting.py | MideTechnology/endaq-python | a878efdd65f718c1324d92d467b19fd3b4142cd0 | [
"MIT"
] | 136 | 2021-09-28T17:45:20.000Z | 2022-03-30T11:35:15.000Z | endaq/cloud/scripting.py | MideTechnology/endaq-python | a878efdd65f718c1324d92d467b19fd3b4142cd0 | [
"MIT"
] | 2 | 2021-11-08T19:22:17.000Z | 2021-12-15T20:25:04.000Z | import requests
from types import FunctionType
import plotly.io as pio
import json
from .core import EndaqCloud, ENV_PRODUCTION, ENV_STAGING, ENV_DEVELOP
__all__ = [
'create_cloud_dashboard_output',
'produce_dashboard_plots',
]
def create_cloud_dashboard_output(name_to_fig: dict) -> str:
"""
A func... | 42.022989 | 117 | 0.696663 | import requests
from types import FunctionType
import plotly.io as pio
import json
from .core import EndaqCloud, ENV_PRODUCTION, ENV_STAGING, ENV_DEVELOP
__all__ = [
'create_cloud_dashboard_output',
'produce_dashboard_plots',
]
def create_cloud_dashboard_output(name_to_fig: dict) -> str:
if not isinsta... | true | true |
f75075d0f4d8469fcd73a5845cfa553be71b2179 | 564 | py | Python | jesse/indicators/mom.py | laughingwithu/jesse | c21adf59074ad62e4aa775261b4ad86c542ec4d5 | [
"MIT"
] | 10 | 2020-05-24T17:31:11.000Z | 2022-03-18T00:31:14.000Z | jesse/indicators/mom.py | laughingwithu/jesse | c21adf59074ad62e4aa775261b4ad86c542ec4d5 | [
"MIT"
] | null | null | null | jesse/indicators/mom.py | laughingwithu/jesse | c21adf59074ad62e4aa775261b4ad86c542ec4d5 | [
"MIT"
] | 4 | 2020-07-08T19:24:45.000Z | 2022-01-26T12:53:04.000Z | import numpy as np
import talib
from typing import Union
def mom(candles: np.ndarray, period=10, sequential=False) -> Union[float, np.ndarray]:
"""
MOM - Momentum
:param candles: np.ndarray
:param period: int - default=10
:param sequential: bool - default=False
:return: float | np.ndarray
... | 21.692308 | 86 | 0.631206 | import numpy as np
import talib
from typing import Union
def mom(candles: np.ndarray, period=10, sequential=False) -> Union[float, np.ndarray]:
if not sequential and len(candles) > 240:
candles = candles[-240:]
res = talib.MOM(candles[:, 2], timeperiod=period)
if sequential:
return res
... | true | true |
f75076365b6f030dfdb62a9cf2176461dcf4d827 | 3,330 | py | Python | core/src/zeit/content/cp/blocks/block.py | louika/vivi | 3cc213b873d527127aa6f0dd3c79a542299a8a0e | [
"BSD-3-Clause"
] | null | null | null | core/src/zeit/content/cp/blocks/block.py | louika/vivi | 3cc213b873d527127aa6f0dd3c79a542299a8a0e | [
"BSD-3-Clause"
] | null | null | null | core/src/zeit/content/cp/blocks/block.py | louika/vivi | 3cc213b873d527127aa6f0dd3c79a542299a8a0e | [
"BSD-3-Clause"
] | null | null | null | import copy
import grokcore.component as grok
import zeit.cms.content.property
import zeit.content.cp.interfaces
import zeit.edit.block
import zeit.edit.interfaces
import zope.component
import zope.interface
@zope.interface.implementer(zeit.content.cp.interfaces.ICenterPage)
@zope.component.adapter(zeit.edit.interfac... | 33.3 | 77 | 0.719219 | import copy
import grokcore.component as grok
import zeit.cms.content.property
import zeit.content.cp.interfaces
import zeit.edit.block
import zeit.edit.interfaces
import zope.component
import zope.interface
@zope.interface.implementer(zeit.content.cp.interfaces.ICenterPage)
@zope.component.adapter(zeit.edit.interfac... | true | true |
f750766c1206017a3ca97315d374f0804ed340d8 | 8,832 | py | Python | tests/conftest.py | ssd71/pytest-md | d0cfaaab4d5d0f5abb76a8b6d7878bf045217e97 | [
"MIT"
] | null | null | null | tests/conftest.py | ssd71/pytest-md | d0cfaaab4d5d0f5abb76a8b6d7878bf045217e97 | [
"MIT"
] | null | null | null | tests/conftest.py | ssd71/pytest-md | d0cfaaab4d5d0f5abb76a8b6d7878bf045217e97 | [
"MIT"
] | null | null | null | import enum
import datetime
import textwrap
import freezegun
import pytest
pytest_plugins = ["pytester"]
@pytest.fixture(name="emoji_tests", autouse=True)
def fixture_emoji_tests(testdir):
"""Create a test module with several tests that produce all the different
pytest test outcomes.
"""
emoji_tests... | 22.762887 | 85 | 0.520607 | import enum
import datetime
import textwrap
import freezegun
import pytest
pytest_plugins = ["pytester"]
@pytest.fixture(name="emoji_tests", autouse=True)
def fixture_emoji_tests(testdir):
emoji_tests = textwrap.dedent(
"""\
import pytest
def test_failed():
assert "emoji" =... | true | true |
f75077925f54b581fd11823a250ad2e427e5d71b | 217 | py | Python | htd_validate/validators/td.py | maliabd-al-majid/nesthdb_asp | 389433b423e39f4a9a00d7e3ed9400400b2cf3b2 | [
"MIT"
] | null | null | null | htd_validate/validators/td.py | maliabd-al-majid/nesthdb_asp | 389433b423e39f4a9a00d7e3ed9400400b2cf3b2 | [
"MIT"
] | null | null | null | htd_validate/validators/td.py | maliabd-al-majid/nesthdb_asp | 389433b423e39f4a9a00d7e3ed9400400b2cf3b2 | [
"MIT"
] | 1 | 2022-01-07T20:58:22.000Z | 2022-01-07T20:58:22.000Z | #!/usr/bin/env false
from htd_validate.decompositions import TreeDecomposition
from htd_validate.validators.validator import Validator
class TreeDecompositionValidator(Validator):
_baseclass = TreeDecomposition
| 27.125 | 57 | 0.847926 |
from htd_validate.decompositions import TreeDecomposition
from htd_validate.validators.validator import Validator
class TreeDecompositionValidator(Validator):
_baseclass = TreeDecomposition
| true | true |
f75077dc7d897a8a887b943ef7ff1870f0302cea | 963 | py | Python | tools/os_deploy_tgen/osclients/neutron.py | shreyagupta30/vineperf | d5c0a03054f720da2a5ff9eba74feee57fb0296d | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2017-05-18T03:25:39.000Z | 2021-04-30T18:35:32.000Z | tools/os_deploy_tgen/osclients/neutron.py | shreyagupta30/vineperf | d5c0a03054f720da2a5ff9eba74feee57fb0296d | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-11-26T09:29:12.000Z | 2021-03-19T22:59:35.000Z | tools/os_deploy_tgen/osclients/neutron.py | shreyagupta30/vineperf | d5c0a03054f720da2a5ff9eba74feee57fb0296d | [
"ECL-2.0",
"Apache-2.0"
] | 16 | 2016-12-09T12:47:04.000Z | 2021-05-20T09:28:37.000Z | # Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 27.514286 | 69 | 0.724818 |
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
def choose_external_net(neutron_client):
ext_nets = neutron_client.list_networks(
**{'router:external': True})['networks']
if not ext_nets:
raise Exception('No external networks found')
return ext_nets[... | true | true |
f7507912090b4c7c06011987ebe71367c18f7af3 | 1,864 | py | Python | users/migrations/0001_initial.py | rodgeraraujo/cv-base | c6bbd19f4586a3c4d065f486c4de6a92e26c1c9b | [
"MIT"
] | 1 | 2019-08-21T20:10:21.000Z | 2019-08-21T20:10:21.000Z | users/migrations/0001_initial.py | rodgeraraujo/cv-base | c6bbd19f4586a3c4d065f486c4de6a92e26c1c9b | [
"MIT"
] | 8 | 2019-10-02T19:44:19.000Z | 2022-02-10T08:30:05.000Z | users/migrations/0001_initial.py | rodgeraraujo/cv-base | c6bbd19f4586a3c4d065f486c4de6a92e26c1c9b | [
"MIT"
] | 4 | 2019-09-17T01:00:55.000Z | 2019-10-02T20:07:36.000Z | # Generated by Django 2.2.4 on 2019-08-27 13:35
# flake8: noqa
# fmt: off
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
... | 49.052632 | 266 | 0.633584 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoFie... | true | true |
f7507a3d59c28bd2ebc4874478474d30496148db | 846 | py | Python | plot_loss_accuracy.py | LJ-LiJiahe/cnn_pytorch | abddc46240a2c7da9818c1cb945d951a8e3b107f | [
"MIT"
] | null | null | null | plot_loss_accuracy.py | LJ-LiJiahe/cnn_pytorch | abddc46240a2c7da9818c1cb945d951a8e3b107f | [
"MIT"
] | null | null | null | plot_loss_accuracy.py | LJ-LiJiahe/cnn_pytorch | abddc46240a2c7da9818c1cb945d951a8e3b107f | [
"MIT"
] | null | null | null | import os
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
import config as cfg
from utils import read_from_pickle_file
# Server to Dell box
matplotlib.use('TkAgg')
train_loss = []
validation_loss = []
train_loss_loc = os.path.join(cfg.loss_dir, 'train_loss')
validation_loss_loc = os.path.j... | 24.171429 | 83 | 0.770686 | import os
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
import config as cfg
from utils import read_from_pickle_file
matplotlib.use('TkAgg')
train_loss = []
validation_loss = []
train_loss_loc = os.path.join(cfg.loss_dir, 'train_loss')
validation_loss_loc = os.path.join(cfg.loss_dir, 'v... | true | true |
f7507aab80565d9a085aad59b3fafd181bc5706f | 207 | py | Python | attic/specialization.py | IMS-workshop/cython-numba | fc9560752f15908d616666df78b1beb970a00a55 | [
"BSD-3-Clause"
] | null | null | null | attic/specialization.py | IMS-workshop/cython-numba | fc9560752f15908d616666df78b1beb970a00a55 | [
"BSD-3-Clause"
] | null | null | null | attic/specialization.py | IMS-workshop/cython-numba | fc9560752f15908d616666df78b1beb970a00a55 | [
"BSD-3-Clause"
] | null | null | null | from numba import jit, int32
@jit(int32(int32, int32))
def f(x, y):
# A somewhat trivial example
return x + y
print(f)
# print(f(123, 123**30))
@jit(nopython=True)
def f(x, y):
return x + y
| 12.9375 | 32 | 0.613527 | from numba import jit, int32
@jit(int32(int32, int32))
def f(x, y):
return x + y
print(f)
@jit(nopython=True)
def f(x, y):
return x + y
| true | true |
f7507b5818f7b62d1fddf589c0144d8f607a92c4 | 754 | py | Python | UMBuysDjango/UMBuysDjango/urls.py | AmberJiang/UMBuys-Django | b572bc858c7e2a66bcaefa0024de24f2651acc8d | [
"MIT"
] | null | null | null | UMBuysDjango/UMBuysDjango/urls.py | AmberJiang/UMBuys-Django | b572bc858c7e2a66bcaefa0024de24f2651acc8d | [
"MIT"
] | null | null | null | UMBuysDjango/UMBuysDjango/urls.py | AmberJiang/UMBuys-Django | b572bc858c7e2a66bcaefa0024de24f2651acc8d | [
"MIT"
] | 1 | 2020-09-21T01:52:38.000Z | 2020-09-21T01:52:38.000Z | """UMBuysDjango URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 34.272727 | 77 | 0.710875 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f7507ca1460359c9dd58dd33f8719c3e1cbc07a1 | 10,260 | py | Python | hubspot/crm/imports/models/public_import_response.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/imports/models/public_import_response.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/imports/models/public_import_response.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
CRM Imports
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from h... | 32.163009 | 203 | 0.62232 |
import pprint
import re
import six
from hubspot.crm.imports.configuration import Configuration
class PublicImportResponse(object):
openapi_types = {
'state': 'str',
'import_request_json': 'object',
'created_at': 'datetime',
'metadata': 'PublicImportMetadata',
'impo... | true | true |
f7507cdf0198ffe4a5b95272eeed2f6ceaf4c817 | 77,777 | py | Python | python-dsl/buck_parser/buck.py | isfaaghyth/buck | cad8f7ac2de2c9a4f08ce66180db677e44d61aee | [
"Apache-2.0"
] | 2 | 2019-09-22T05:33:37.000Z | 2019-09-22T06:36:24.000Z | python-dsl/buck_parser/buck.py | isfaaghyth/buck | cad8f7ac2de2c9a4f08ce66180db677e44d61aee | [
"Apache-2.0"
] | 1 | 2019-10-22T21:07:17.000Z | 2019-10-22T21:07:17.000Z | python-dsl/buck_parser/buck.py | isfaaghyth/buck | cad8f7ac2de2c9a4f08ce66180db677e44d61aee | [
"Apache-2.0"
] | 1 | 2019-10-22T20:43:48.000Z | 2019-10-22T20:43:48.000Z | # Copyright 2018-present Facebook, 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 i... | 36.141729 | 108 | 0.626535 |
from __future__ import absolute_import, division, print_function, with_statement
import abc
import collections
import contextlib
import functools
import imp
import inspect
import json
import optparse
import os
import os.path
import platform
import re
import sys
import time
import traceback
import types
f... | true | true |
f7507d0983774076cc9f2f48c0d29a72bca63ecd | 9,071 | py | Python | homeassistant/components/homekit_controller/__init__.py | dummys/home-assistant | dd908caebade15adf061fade686355b94ed2f43a | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/homekit_controller/__init__.py | dummys/home-assistant | dd908caebade15adf061fade686355b94ed2f43a | [
"Apache-2.0"
] | 64 | 2020-10-01T06:39:48.000Z | 2022-03-31T06:02:17.000Z | homeassistant/components/homekit_controller/__init__.py | dummys/home-assistant | dd908caebade15adf061fade686355b94ed2f43a | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Support for Homekit device discovery."""
from __future__ import annotations
import asyncio
from typing import Any
import aiohomekit
from aiohomekit.model import Accessory
from aiohomekit.model.characteristics import (
Characteristic,
CharacteristicPermissions,
CharacteristicsTypes,
)
from aiohomekit.mo... | 35.29572 | 115 | 0.688678 | from __future__ import annotations
import asyncio
from typing import Any
import aiohomekit
from aiohomekit.model import Accessory
from aiohomekit.model.characteristics import (
Characteristic,
CharacteristicPermissions,
CharacteristicsTypes,
)
from aiohomekit.model.services import Service, ServicesTypes
... | true | true |
f7507f0827631ec4e025e391dc8d693c2e0bf256 | 20,549 | py | Python | flux_combined_high_binding/model_571.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_571.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_571.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.134259 | 798 | 0.804127 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f7507f320f6e555a36be9be0ee284913056143da | 3,873 | py | Python | deepab/resnets/CrissCrossResNet2D.py | antonkulaga/DeepAb | 51a32d06d19815705bdbfb35a8a9518c17ec313a | [
"RSA-MD"
] | 67 | 2021-07-02T08:31:10.000Z | 2022-03-30T01:25:11.000Z | deepab/resnets/CrissCrossResNet2D.py | antonkulaga/DeepAb | 51a32d06d19815705bdbfb35a8a9518c17ec313a | [
"RSA-MD"
] | 9 | 2021-08-18T10:32:27.000Z | 2022-03-30T06:40:05.000Z | deepab/resnets/CrissCrossResNet2D.py | antonkulaga/DeepAb | 51a32d06d19815705bdbfb35a8a9518c17ec313a | [
"RSA-MD"
] | 16 | 2021-07-17T08:33:30.000Z | 2022-03-29T07:36:34.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from einops import rearrange, repeat
class CrissCrossAttention(nn.Module):
def __init__(self, in_dim):
super(CrissCrossAttention, self).__init__()
self.query_conv = nn.Conv2d(in_channel... | 38.346535 | 79 | 0.497289 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from einops import rearrange, repeat
class CrissCrossAttention(nn.Module):
def __init__(self, in_dim):
super(CrissCrossAttention, self).__init__()
self.query_conv = nn.Conv2d(in_channel... | true | true |
f7507f9946f20477aae4dcf791660659f3e2bed7 | 7,852 | py | Python | lib/vuln/clickjacking/engine.py | th3cyb3rc0p/Nettacker | 24640d8695716aee48435710287f58486ed174ab | [
"Apache-2.0"
] | 1 | 2021-08-15T16:17:06.000Z | 2021-08-15T16:17:06.000Z | lib/vuln/clickjacking/engine.py | th3cyb3rc0p/Nettacker | 24640d8695716aee48435710287f58486ed174ab | [
"Apache-2.0"
] | null | null | null | lib/vuln/clickjacking/engine.py | th3cyb3rc0p/Nettacker | 24640d8695716aee48435710287f58486ed174ab | [
"Apache-2.0"
] | 1 | 2021-04-22T18:40:50.000Z | 2021-04-22T18:40:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Pradeep Jairamani , github.com/pradeepjairamani
import socket
import socks
import time
import json
import threading
import string
import random
import sys
import struct
import re
import os
from OpenSSL import crypto
import ssl
from core.alert import *
from core.t... | 45.651163 | 436 | 0.595644 |
import socket
import socks
import time
import json
import threading
import string
import random
import sys
import struct
import re
import os
from OpenSSL import crypto
import ssl
from core.alert import *
from core.targets import target_type
from core.targets import target_to_host
from core.load_modules import load_... | true | true |
f75080b4ae9b8cf6ba5f97692094e9761a778336 | 9,406 | py | Python | Outils/IHM/TRUST_WIZARD/src/jig/views.py | cea-trust-platform/trust-code | c4f42d8f8602a8cc5e0ead0e29dbf0be8ac52f72 | [
"BSD-3-Clause"
] | 12 | 2021-06-30T18:50:38.000Z | 2022-03-23T09:03:16.000Z | Outils/IHM/TRUST_WIZARD/src/jig/views.py | pledac/trust-code | 46ab5c5da3f674185f53423090f526a38ecdbad1 | [
"BSD-3-Clause"
] | null | null | null | Outils/IHM/TRUST_WIZARD/src/jig/views.py | pledac/trust-code | 46ab5c5da3f674185f53423090f526a38ecdbad1 | [
"BSD-3-Clause"
] | 2 | 2021-10-04T09:19:39.000Z | 2021-12-15T14:21:04.000Z | #
# Author : A. Bruneton
#
from pyqtside.QtGui import QGridLayout, QVBoxLayout, QTabWidget, QWidget, QLabel, QGroupBox
from pyqtside.QtCore import Qt
def setup4Lay(lay):
""" Handy function to setup a 4-cols layout """
lay.setColumnStretch(0, 0)
lay.setColumnStretch(1, 10)
lay.setColumnStretch(2, 20)
lay.set... | 34.07971 | 144 | 0.675739 |
from pyqtside.QtGui import QGridLayout, QVBoxLayout, QTabWidget, QWidget, QLabel, QGroupBox
from pyqtside.QtCore import Qt
def setup4Lay(lay):
lay.setColumnStretch(0, 0)
lay.setColumnStretch(1, 10)
lay.setColumnStretch(2, 20)
lay.setColumnStretch(3, 10)
class JigView(object):
def __init__(self, jig_wi... | true | true |
f75080d1a9d4fe9d7e4a480074bf1416f371b029 | 829 | py | Python | snippets/migrations/0002_auto_20200424_1055.py | gideon-maina/code-snippets-django-rest-app | 3970834e9717b1321c9617763368a2aa9e0a3b69 | [
"MIT"
] | null | null | null | snippets/migrations/0002_auto_20200424_1055.py | gideon-maina/code-snippets-django-rest-app | 3970834e9717b1321c9617763368a2aa9e0a3b69 | [
"MIT"
] | null | null | null | snippets/migrations/0002_auto_20200424_1055.py | gideon-maina/code-snippets-django-rest-app | 3970834e9717b1321c9617763368a2aa9e0a3b69 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-24 10:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('snippets', '0001_initial... | 28.586207 | 146 | 0.635706 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('snippets', '0001_initial'),
]
operations = [
migration... | true | true |
f75080f5e85b196e7eaf91c015d47b47364a9581 | 3,221 | py | Python | jangjorim_games/game1.py | jackyoung96/Jumple | bf60e16b4cb86413fede02f07609ed0416e9fdef | [
"Apache-2.0"
] | null | null | null | jangjorim_games/game1.py | jackyoung96/Jumple | bf60e16b4cb86413fede02f07609ed0416e9fdef | [
"Apache-2.0"
] | null | null | null | jangjorim_games/game1.py | jackyoung96/Jumple | bf60e16b4cb86413fede02f07609ed0416e9fdef | [
"Apache-2.0"
] | 1 | 2021-12-20T09:01:23.000Z | 2021-12-20T09:01:23.000Z | import cv2
import random
import math
import numpy as np
import os
import sys
from jangjorim_client import resource_path
# constants
threshold = 50
interpol = 0.7
velocity = 0
# target color
target_color = {
"blue" : (255,0,0),
"green" : (0,255,0),
"red" : (0,0,255),
"yellow" : (0,255,255),
"origin" : (255,... | 29.824074 | 145 | 0.627134 | import cv2
import random
import math
import numpy as np
import os
import sys
from jangjorim_client import resource_path
threshold = 50
interpol = 0.7
velocity = 0
target_color = {
"blue" : (255,0,0),
"green" : (0,255,0),
"red" : (0,0,255),
"yellow" : (0,255,255),
"origin" : (255,255,255)
}
explain = "C... | true | true |
f75082f5138c86fc69e67602b973c94db8d94404 | 993 | py | Python | Examples/WorkingWithOutlookStorageFiles/AccessContactInformation.py | Muzammil-khan/Aspose.Email-Python-Dotnet | 04ca3a6f440339f3ddf316218f92d15d66f24e7e | [
"MIT"
] | 5 | 2019-01-28T05:17:12.000Z | 2020-04-14T14:31:34.000Z | Examples/WorkingWithOutlookStorageFiles/AccessContactInformation.py | Muzammil-khan/Aspose.Email-Python-Dotnet | 04ca3a6f440339f3ddf316218f92d15d66f24e7e | [
"MIT"
] | 1 | 2019-01-28T16:07:26.000Z | 2021-11-25T10:59:52.000Z | Examples/WorkingWithOutlookStorageFiles/AccessContactInformation.py | Muzammil-khan/Aspose.Email-Python-Dotnet | 04ca3a6f440339f3ddf316218f92d15d66f24e7e | [
"MIT"
] | 6 | 2018-07-16T14:57:34.000Z | 2020-08-30T05:59:52.000Z | from aspose.email.storage.pst import *
from aspose.email.mapi import MapiContact
from aspose.email.mapi import ContactSaveFormat
def run():
dataDir = "Data/"
#ExStart: AccessContactInformation
pst = PersonalStorage.from_file(dataDir + "SampleContacts_out.pst")
folderInfo = pst.get_predefined_folder(StandardIp... | 30.090909 | 110 | 0.762336 | from aspose.email.storage.pst import *
from aspose.email.mapi import MapiContact
from aspose.email.mapi import ContactSaveFormat
def run():
dataDir = "Data/"
pst = PersonalStorage.from_file(dataDir + "SampleContacts_out.pst")
folderInfo = pst.get_predefined_folder(StandardIpmFolder.CONTACTS)
messageInfoCol... | true | true |
f75086978dd50f79ac36167c497f6306d2960ec0 | 1,159 | py | Python | setup.py | MarcoFavorito/breakout-env | b41f9ed1da693874d7d34f83e7200fd51a59c97e | [
"MIT"
] | null | null | null | setup.py | MarcoFavorito/breakout-env | b41f9ed1da693874d7d34f83e7200fd51a59c97e | [
"MIT"
] | null | null | null | setup.py | MarcoFavorito/breakout-env | b41f9ed1da693874d7d34f83e7200fd51a59c97e | [
"MIT"
] | null | null | null | import os
import re
from setuptools import setup, find_packages
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
read_md = lambda f: open(f, 'r').read()
def read_version():
# __PATH__ = ... | 33.114286 | 86 | 0.708369 | import os
import re
from setuptools import setup, find_packages
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
read_md = lambda f: open(f, 'r').read()
def read_version():
# if... | true | true |
f75086e3ee482871fd491b545c98d9df4ac885df | 9,482 | py | Python | stuff/scripts/stuff/PointCloudViz.py | eugeniu1994/Update_CV | 562b646e02ffb374dae428a7b6f3ae1debecc997 | [
"Apache-2.0"
] | null | null | null | stuff/scripts/stuff/PointCloudViz.py | eugeniu1994/Update_CV | 562b646e02ffb374dae428a7b6f3ae1debecc997 | [
"Apache-2.0"
] | null | null | null | stuff/scripts/stuff/PointCloudViz.py | eugeniu1994/Update_CV | 562b646e02ffb374dae428a7b6f3ae1debecc997 | [
"Apache-2.0"
] | null | null | null | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
skip = 15
#source = '/home/eugen/catkin_ws/src/Camera_Lidar/DATA/pcd/0002.csv'
#data = np.genfromtxt(source, delimiter=',')[1::skip,:3]
#print ('data ', np.shape(data))
#x,y,z = data[:,0],data[:,1],data[:,2]
'''fig = plt.figur... | 30.006329 | 118 | 0.539338 | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
skip = 15
def fit_plane_scipy(P=None):
from skspatial.objects import Points, Plane
from skspatial.plotting import plot_3d
points = Points([[0, 0, 0], [1, 3, 5], [-5, 6, 3], [3, 6, 7], [-2, 6, 7]]) if P is No... | true | true |
f75087a78f77e0d4c89829229eed6321ef8c1f10 | 43,717 | py | Python | client/verta/verta/_dataset.py | VaidehiHardikar/modeldb | 7315ac75c033e8b2d032e3e563726421d67e4ba9 | [
"Apache-2.0"
] | null | null | null | client/verta/verta/_dataset.py | VaidehiHardikar/modeldb | 7315ac75c033e8b2d032e3e563726421d67e4ba9 | [
"Apache-2.0"
] | 3 | 2021-05-11T23:56:43.000Z | 2022-02-27T11:16:47.000Z | client/verta/verta/_dataset.py | VaidehiHardikar/modeldb | 7315ac75c033e8b2d032e3e563726421d67e4ba9 | [
"Apache-2.0"
] | 3 | 2020-11-18T19:36:47.000Z | 2021-01-19T19:48:54.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import hashlib
import os
import time
import warnings
import requests
from ._protos.public.common import CommonService_pb2 as _CommonCommonService
from ._protos.public.modeldb import DatasetService_pb2 as _DatasetService
from ._protos.public.modeldb impor... | 43.070936 | 174 | 0.606812 |
from __future__ import print_function
import hashlib
import os
import time
import warnings
import requests
from ._protos.public.common import CommonService_pb2 as _CommonCommonService
from ._protos.public.modeldb import DatasetService_pb2 as _DatasetService
from ._protos.public.modeldb import DatasetVersionService... | true | true |
f75087ca3b5052428ebc6abc5958f67a06737079 | 6,456 | py | Python | pandas/core/indexers.py | mlline00/pandas | fd7db9819b8c7dba86b2887bee33f670b2715afc | [
"BSD-3-Clause"
] | 1 | 2021-04-01T11:19:53.000Z | 2021-04-01T11:19:53.000Z | pandas/core/indexers.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexers.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | null | null | null | """
Low-dependency indexing utilities.
"""
import numpy as np
from pandas.core.dtypes.common import is_list_like
from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries
# -----------------------------------------------------------
# Indexer Identification
def is_list_like_indexer(key) -> bool:
"""
C... | 26.567901 | 88 | 0.561803 | import numpy as np
from pandas.core.dtypes.common import is_list_like
from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries
def is_list_like_indexer(key) -> bool:
return is_list_like(key) and not (isinstance(key, tuple) and type(key) is not tuple)
def is_scalar_indexer(indexer, arr_value) -> ... | true | true |
f7508888a4b737bedf5651cc41ee3d781a0a77ca | 11,734 | py | Python | msgvis/apps/base/tests.py | hds-lab/textvis-drg | bfb136b6105df84fb6c1c89cc595bf9e9f22c5fe | [
"MIT"
] | 10 | 2015-12-04T07:43:11.000Z | 2021-01-23T00:44:56.000Z | msgvis/apps/base/tests.py | hds-lab/textvis-drg | bfb136b6105df84fb6c1c89cc595bf9e9f22c5fe | [
"MIT"
] | 200 | 2015-02-11T05:41:57.000Z | 2015-11-13T03:47:25.000Z | msgvis/apps/base/tests.py | hds-lab/textvis-drg | bfb136b6105df84fb6c1c89cc595bf9e9f22c5fe | [
"MIT"
] | 6 | 2015-10-02T18:01:09.000Z | 2021-01-23T00:44:58.000Z | from django.test import TestCase
import mock
from templatetags import active
from msgvis.apps.corpus import models as corpus_models
from django.utils import timezone as tz
from datetime import timedelta
class TemplateTagActiveTest(TestCase):
def test_matches_request_path(self):
request = mock.Mock()
... | 36.66875 | 109 | 0.609255 | from django.test import TestCase
import mock
from templatetags import active
from msgvis.apps.corpus import models as corpus_models
from django.utils import timezone as tz
from datetime import timedelta
class TemplateTagActiveTest(TestCase):
def test_matches_request_path(self):
request = mock.Mock()
... | true | true |
f7508deac6aa4740c35fd747db21d74a8bc87a0c | 41,225 | py | Python | mmpdblib/commandline.py | gedeck/mmpdb | a79462f9e7b92a6709529f2fde0ae10e2b7efbe1 | [
"MIT"
] | null | null | null | mmpdblib/commandline.py | gedeck/mmpdb | a79462f9e7b92a6709529f2fde0ae10e2b7efbe1 | [
"MIT"
] | null | null | null | mmpdblib/commandline.py | gedeck/mmpdb | a79462f9e7b92a6709529f2fde0ae10e2b7efbe1 | [
"MIT"
] | 2 | 2021-09-29T15:24:22.000Z | 2021-12-05T15:17:58.000Z | # mmpdb - matched molecular pair database generation and analysis
#
# Copyright (c) 2015-2017, F. Hoffmann-La Roche Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must ret... | 40.938431 | 120 | 0.729242 |
from __future__ import print_function, absolute_import
import argparse
from . import __version__ as _version
from . import config
from . import smarts_aliases
from . import do_help
:
parser.add_argument("databases", nargs=1, metavar="DATABASE",
help="locat... | true | true |
f7508e2441bfec4b137b49fdd49d2a076d471d94 | 1,237 | py | Python | test/test_add_student.py | Parenty/pytest | e105c547623e028af2c8c38195540144a1f662d8 | [
"Apache-2.0"
] | 1 | 2019-04-28T09:52:58.000Z | 2019-04-28T09:52:58.000Z | test/test_add_student.py | Parenty/pytest | e105c547623e028af2c8c38195540144a1f662d8 | [
"Apache-2.0"
] | null | null | null | test/test_add_student.py | Parenty/pytest | e105c547623e028af2c8c38195540144a1f662d8 | [
"Apache-2.0"
] | null | null | null | import pytest
from data.add_student import testdata_add_student
from model.registration import Reg
@pytest.mark.run(order=3)
# @pytest.mark.repeat(20)
@pytest.mark.parametrize('students', testdata_add_student, ids=[repr(x) for x in testdata_add_student])
def test_add_student(app, students):
user = 'dmitriev+9@uch... | 36.382353 | 103 | 0.716249 | import pytest
from data.add_student import testdata_add_student
from model.registration import Reg
@pytest.mark.run(order=3)
@pytest.mark.parametrize('students', testdata_add_student, ids=[repr(x) for x in testdata_add_student])
def test_add_student(app, students):
user = 'dmitriev+9@uchi.ru'
pswd = '1'
... | true | true |
f7508e9e0961249b81b91d13fba717e54a9628f1 | 1,297 | py | Python | LearnNetworkProgramming/message.py | fyabc/Toys | 3b2abd4fb2be986a8be6ed83897f7ba7fad6929e | [
"MIT"
] | 1 | 2016-08-17T10:36:03.000Z | 2016-08-17T10:36:03.000Z | LearnNetworkProgramming/message.py | fyabc/Toys | 3b2abd4fb2be986a8be6ed83897f7ba7fad6929e | [
"MIT"
] | null | null | null | LearnNetworkProgramming/message.py | fyabc/Toys | 3b2abd4fb2be986a8be6ed83897f7ba7fad6929e | [
"MIT"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
import json
import time
class Message:
def __init__(self, type: str, data: dict, timestamp: float = None):
self.timestamp = time.time() if timestamp is None else timestamp
self.type = type
self.data = data
self.client_address = None
... | 23.160714 | 72 | 0.572089 |
import json
import time
class Message:
def __init__(self, type: str, data: dict, timestamp: float = None):
self.timestamp = time.time() if timestamp is None else timestamp
self.type = type
self.data = data
self.client_address = None
def set_client_address(self, client_addre... | true | true |
f7508f732015eec0aee29e5b2410c5b837fbcb7f | 1,607 | py | Python | setup.py | jspisak/tensorpipe | 5855335659b3078477cf752ecd9e7b8614091e14 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jspisak/tensorpipe | 5855335659b3078477cf752ecd9e7b8614091e14 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jspisak/tensorpipe | 5855335659b3078477cf752ecd9e7b8614091e14 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import os
import subprocess
import sys
from pathlib import Path
from setuptools import Ex... | 29.218182 | 76 | 0.654014 |
import os
import subprocess
import sys
from pathlib import Path
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
class CMakeBuild(build_ext):
def run(self):
for ext in self.extensions:
self.build_extension(ext)
def build_extension(self, ex... | true | true |
f75091478149cd281f679fdfb53f440532d3c3f9 | 2,944 | py | Python | Reference/progs/graph_shortestpath_1.py | waynerv/data-structures-and-algorithms-in-python | fa78eca47d8f6d29382172873cd0922c09fd9c5e | [
"MIT"
] | 14 | 2019-03-27T15:46:58.000Z | 2022-02-14T08:11:10.000Z | Reference/progs/graph_shortestpath_1.py | waynerv/data-structures-and-algorithms-in-python | fa78eca47d8f6d29382172873cd0922c09fd9c5e | [
"MIT"
] | null | null | null | Reference/progs/graph_shortestpath_1.py | waynerv/data-structures-and-algorithms-in-python | fa78eca47d8f6d29382172873cd0922c09fd9c5e | [
"MIT"
] | 6 | 2019-09-11T14:42:06.000Z | 2021-08-06T07:26:52.000Z | """ 单源点最短路径算法,所有顶点对之间的最短路径算法
"""
from prioqueue import PrioQueue # , PrioQueueError
from graph import *
# Find nearest pathes from a single vertex to other reachable
# vertices using Dijkstra algorithm.
# Use a loop to find next nearest vertex, time O(V^2), space O(V)
def dijkstra_shortest_paths(graph, v... | 34.635294 | 76 | 0.547554 |
from prioqueue import PrioQueue
from graph import *
def dijkstra_shortest_paths(graph, v0):
vnum = graph.vertex_num()
assert vnum > 0 and 0 <= v0 < vnum
count, paths = 0, [None]*vnum
cands = [(inf, v0, i) for i in range(graph.vertex_num())]
cands[v0] = (0, v0, v0)
vmin = v0
... | true | true |
f750920ea377b2261487e48388b89864774f8201 | 482 | py | Python | test/unit/test_package.py | tszyrowski/bpp-speech | 9c8ab04823abb06c0bbe31ff52055d0940b701c0 | [
"Apache-2.0"
] | null | null | null | test/unit/test_package.py | tszyrowski/bpp-speech | 9c8ab04823abb06c0bbe31ff52055d0940b701c0 | [
"Apache-2.0"
] | null | null | null | test/unit/test_package.py | tszyrowski/bpp-speech | 9c8ab04823abb06c0bbe31ff52055d0940b701c0 | [
"Apache-2.0"
] | null | null | null | import importlib
def test_import():
"""The package imports correctly."""
# Capturing the exception and then asserting for it makes the failure mode
# look normal; if we call pytest.fail() inside the except block, we get
# a long traceback with exceptions raised during outer exception handling.
exc... | 30.125 | 78 | 0.709544 | import importlib
def test_import():
exception = None
try:
importlib.import_module("bpp_speech")
except ModuleNotFoundError as err:
exception = err
assert exception is None
| true | true |
f750936961831b353a8644458c2158e5e9b9ea96 | 42,738 | py | Python | pandas/tests/test_base.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-28T13:48:34.000Z | 2019-04-28T13:48:34.000Z | pandas/tests/test_base.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/tests/test_base.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2021-02-20T14:17:15.000Z | 2021-02-20T14:17:15.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import pandas.compat as compat
from pandas.types.common import (is_object_dtype, is_datetimetz,
needs_i8_conversion)
impo... | 38.295699 | 79 | 0.519327 |
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import pandas.compat as compat
from pandas.types.common import (is_object_dtype, is_datetimetz,
needs_i8_conversion)
import pandas.util.testing ... | true | true |
f75093d533df1d50b156ef2369801ccd34b4f866 | 10,593 | py | Python | model.py | randomir/dendritic-growth-model | aea14e26c8b130caa88d881bf7c78507ff5624f0 | [
"MIT"
] | null | null | null | model.py | randomir/dendritic-growth-model | aea14e26c8b130caa88d881bf7c78507ff5624f0 | [
"MIT"
] | null | null | null | model.py | randomir/dendritic-growth-model | aea14e26c8b130caa88d881bf7c78507ff5624f0 | [
"MIT"
] | null | null | null | """
Dendritic Geometry Model, described by Jaap van Pelt et al. in [1], chapter 7.1.
[1] Computational neuroscience: Realistic modeling for experimentalists,
edited by Erik De Schutter, 2001, CRC Press.
"""
import math
import random
import textwrap
import itertools
from utils import counted
class InvalidModelParam(... | 37.299296 | 132 | 0.633154 | import math
import random
import textwrap
import itertools
from utils import counted
class InvalidModelParam(Exception):
class Segment(object):
order = 0
# segment's degree: the number of terminal segments in a subtree rooted at this segment.
degree = 1
dendrite = None
... | true | true |
f750941c03918e0c35f1c2b4ca0fc4a6fdeb3f80 | 18,761 | py | Python | MainProject/dist/main/server/app.py | stuayu/team6 | e843b5f50e873e36d0a38a4fb2b74e6b00f8c4ad | [
"MIT"
] | 2 | 2021-06-22T02:12:44.000Z | 2021-07-26T16:01:11.000Z | MainProject/dist/main/server/app.py | stuayu/team6 | e843b5f50e873e36d0a38a4fb2b74e6b00f8c4ad | [
"MIT"
] | null | null | null | MainProject/dist/main/server/app.py | stuayu/team6 | e843b5f50e873e36d0a38a4fb2b74e6b00f8c4ad | [
"MIT"
] | 4 | 2021-06-11T05:20:21.000Z | 2021-07-26T15:56:04.000Z | from typing import Counter
from warnings import resetwarnings
from bottle import route, run, request, template
import os
import csv
import webbrowser
cwd = os.getcwd()
xcwd = cwd.replace('\\','/')
print(xcwd)
sscwd = xcwd + "/server/security"
print(sscwd)
def fsync():
global sscwd
ssucwd = sscwd + "/user.csv... | 38.923237 | 110 | 0.619583 | from typing import Counter
from warnings import resetwarnings
from bottle import route, run, request, template
import os
import csv
import webbrowser
cwd = os.getcwd()
xcwd = cwd.replace('\\','/')
print(xcwd)
sscwd = xcwd + "/server/security"
print(sscwd)
def fsync():
global sscwd
ssucwd = sscwd + "/user.csv... | true | true |
f75094ef4427a47028e32f8084b2c0603f5167f7 | 3,204 | py | Python | pygsti/report/cell.py | colibri-coruscans/pyGSTi | da54f4abf668a28476030528f81afa46a1fbba33 | [
"Apache-2.0"
] | 73 | 2016-01-28T05:02:05.000Z | 2022-03-30T07:46:33.000Z | pygsti/report/cell.py | colibri-coruscans/pyGSTi | da54f4abf668a28476030528f81afa46a1fbba33 | [
"Apache-2.0"
] | 113 | 2016-02-25T15:32:18.000Z | 2022-03-31T13:18:13.000Z | pygsti/report/cell.py | colibri-coruscans/pyGSTi | da54f4abf668a28476030528f81afa46a1fbba33 | [
"Apache-2.0"
] | 41 | 2016-03-15T19:32:07.000Z | 2022-02-16T10:22:05.000Z | """
Defines the Cell class
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain right... | 30.807692 | 101 | 0.554307 |
from pygsti.report.convert import convert_dict as _convert_dict
from pygsti.report.formatters import format_dict as _format_dict
class Cell(object):
def __init__(self, data=None, formatter_name=None, label=None):
self.data = data
self.formatterName = formatter_name
self.label = ... | true | true |
f750950ad98ab652407d437cb23b601d678b92e4 | 1,061 | py | Python | PyNEng/put_data_v0.py | nyukers/Testing-by-Python | a528be8911adf0f9c6d4252cc59f367783f528d3 | [
"Apache-2.0"
] | null | null | null | PyNEng/put_data_v0.py | nyukers/Testing-by-Python | a528be8911adf0f9c6d4252cc59f367783f528d3 | [
"Apache-2.0"
] | null | null | null | PyNEng/put_data_v0.py | nyukers/Testing-by-Python | a528be8911adf0f9c6d4252cc59f367783f528d3 | [
"Apache-2.0"
] | 1 | 2020-10-02T18:29:58.000Z | 2020-10-02T18:29:58.000Z | import os
import sqlite3
import re
data_filename = 'dhcp_snooping.txt'
db_filename = 'dhcp_snooping.db'
schema_filename = 'dhcp_snooping_schema.sql'
regex = re.compile(r'(\S+) +(\S+) +\d+ +\S+ +(\d+) +(\S+)')
result = []
with open('dhcp_snooping.txt') as data:
for line in data:
match = reg... | 24.674419 | 67 | 0.589067 | import os
import sqlite3
import re
data_filename = 'dhcp_snooping.txt'
db_filename = 'dhcp_snooping.db'
schema_filename = 'dhcp_snooping_schema.sql'
regex = re.compile(r'(\S+) +(\S+) +\d+ +\S+ +(\d+) +(\S+)')
result = []
with open('dhcp_snooping.txt') as data:
for line in data:
match = reg... | true | true |
f750951c50361ff4970990d72352d09eb6fa1297 | 6,449 | py | Python | configs/gn+ws/mask_rcnn_x101_32x4d_fpn_gn_ws_2x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/gn+ws/mask_rcnn_x101_32x4d_fpn_gn_ws_2x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/gn+ws/mask_rcnn_x101_32x4d_fpn_gn_ws_2x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # model settings
conv_cfg = dict(type='ConvWS')
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
type='MaskRCNN',
pretrained='open-mmlab://jhu/resnext101_32x4d_gn_ws',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
... | 31.612745 | 79 | 0.575903 |
conv_cfg = dict(type='ConvWS')
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
type='MaskRCNN',
pretrained='open-mmlab://jhu/resnext101_32x4d_gn_ws',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4... | true | true |
f750952299f3ce2942b0325e5b345b7e89f255f3 | 2,711 | py | Python | unittests/decl_string_tester.py | mamoll/pygccxml | 91348c3e56ec891496c00bc7771e647791114c7d | [
"BSL-1.0"
] | null | null | null | unittests/decl_string_tester.py | mamoll/pygccxml | 91348c3e56ec891496c00bc7771e647791114c7d | [
"BSL-1.0"
] | null | null | null | unittests/decl_string_tester.py | mamoll/pygccxml | 91348c3e56ec891496c00bc7771e647791114c7d | [
"BSL-1.0"
] | null | null | null | # Copyright 2014-2016 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import unittest
import autoconfig
import parser_test_case
from pygccxml import parser
from pygccxml import declarat... | 33.060976 | 76 | 0.65474 |
import os
import unittest
import autoconfig
import parser_test_case
from pygccxml import parser
from pygccxml import declarations
class tester_t(parser_test_case.parser_test_case_t):
COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE
global_ns = None
def __init__(self, *args):
parser_tes... | true | true |
f750973aff3fef38c91b05f68337424789503882 | 30,441 | py | Python | conans/test/unittests/client/generators/cmake_test.py | noverby/conan | 5e560ce806be28416e80544e767b1bca3f48d11e | [
"MIT"
] | null | null | null | conans/test/unittests/client/generators/cmake_test.py | noverby/conan | 5e560ce806be28416e80544e767b1bca3f48d11e | [
"MIT"
] | null | null | null | conans/test/unittests/client/generators/cmake_test.py | noverby/conan | 5e560ce806be28416e80544e767b1bca3f48d11e | [
"MIT"
] | null | null | null | import os
import re
import unittest
import six
from conans.client.build.cmake_flags import CMakeDefinitionsBuilder
from conans.client.conf import default_settings_yml
from conans.client.generators import CMakeFindPackageGenerator, CMakeFindPackageMultiGenerator
from conans.client.generators.cmake import CMakeGenerato... | 50.735 | 107 | 0.683946 | import os
import re
import unittest
import six
from conans.client.build.cmake_flags import CMakeDefinitionsBuilder
from conans.client.conf import default_settings_yml
from conans.client.generators import CMakeFindPackageGenerator, CMakeFindPackageMultiGenerator
from conans.client.generators.cmake import CMakeGenerato... | true | true |
f75097798b0cc0a2ec6170085d879acf60213bf1 | 279 | py | Python | config.py | dgoodwin208/6.883ProteinDocking | 07f33688bd5ec8c5ae6d4d4113eb64b0f2352e9e | [
"Apache-2.0"
] | 91 | 2020-04-04T21:00:23.000Z | 2022-03-25T06:15:11.000Z | config.py | dgoodwin208/6.883ProteinDocking | 07f33688bd5ec8c5ae6d4d4113eb64b0f2352e9e | [
"Apache-2.0"
] | 4 | 2020-05-03T02:42:26.000Z | 2021-08-16T14:32:05.000Z | config.py | dgoodwin208/6.883ProteinDocking | 07f33688bd5ec8c5ae6d4d4113eb64b0f2352e9e | [
"Apache-2.0"
] | 23 | 2020-05-03T00:35:18.000Z | 2022-03-30T10:20:39.000Z | import torch
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
FloatTensor = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor
LongTensor = torch.cuda.LongTensor if torch.cuda.is_available() else torch.LongTensor
| 46.5 | 88 | 0.781362 | import torch
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
FloatTensor = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor
LongTensor = torch.cuda.LongTensor if torch.cuda.is_available() else torch.LongTensor
| true | true |
f750988b612c66128a7487df73d237b1073dd47b | 1,634 | py | Python | aaem/components/biomass_wood/config.py | gina-alaska/alaska_affordable_energy_model | 96fed0137152985ce280ea37e0affec131e3087f | [
"MIT-feh"
] | 1 | 2022-01-23T07:18:36.000Z | 2022-01-23T07:18:36.000Z | aaem/components/biomass_wood/config.py | gina-alaska/alaska_affordable_energy_model | 96fed0137152985ce280ea37e0affec131e3087f | [
"MIT-feh"
] | 5 | 2017-07-14T21:56:46.000Z | 2017-07-14T21:59:15.000Z | aaem/components/biomass_wood/config.py | gina-alaska/alaska_affordable_energy_model | 96fed0137152985ce280ea37e0affec131e3087f | [
"MIT-feh"
] | 2 | 2020-04-28T18:12:55.000Z | 2021-01-13T01:56:57.000Z | """
Biomass Pellet configuration
----------------------------
Contains biomass wood configuration info for
community data yaml file, and other set-up requirements
"""
import aaem.components.biomass_base as bmb
from copy import deepcopy
COMPONENT_NAME = "Biomass for Heat (Cordwood)"
IMPORT = "IMPORT"
UNKNOWN =... | 28.666667 | 86 | 0.665239 | import aaem.components.biomass_base as bmb
from copy import deepcopy
COMPONENT_NAME = "Biomass for Heat (Cordwood)"
IMPORT = "IMPORT"
UNKNOWN = "UNKNOWN"
order = deepcopy(bmb.order)
order += [
"hours of storage for peak",
"percent at max output",
"cordwood system efficiency",
"hours operation per cord... | true | true |
f75098ae2c8f6222c7cde52b8e28c5f2ea2f8e92 | 9,342 | py | Python | src/modules/audio_processing/test/py_quality_assessment/quality_assessment/test_data_generation_unittest.py | ilya-fedin/tg_owt | d5c3d43b959c7e9e7d8004b9b7fdadd12ce7d589 | [
"BSD-3-Clause"
] | 162 | 2018-04-03T04:29:45.000Z | 2022-03-30T19:41:27.000Z | src/modules/audio_processing/test/py_quality_assessment/quality_assessment/test_data_generation_unittest.py | ilya-fedin/tg_owt | d5c3d43b959c7e9e7d8004b9b7fdadd12ce7d589 | [
"BSD-3-Clause"
] | 59 | 2020-08-24T09:17:42.000Z | 2022-02-27T23:33:37.000Z | src/modules/audio_processing/test/py_quality_assessment/quality_assessment/test_data_generation_unittest.py | ilya-fedin/tg_owt | d5c3d43b959c7e9e7d8004b9b7fdadd12ce7d589 | [
"BSD-3-Clause"
] | 62 | 2018-03-26T08:38:18.000Z | 2022-03-14T02:29:47.000Z | # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 44.913462 | 86 | 0.665489 |
import os
import shutil
import tempfile
import unittest
import numpy as np
import scipy.io
from . import test_data_generation
from . import test_data_generation_factory
from . import signal_processing
class TestTestDataGenerators(unittest.TestCase):
def setUp(self):
self._base_output_path = tem... | true | true |
f75099d1b689009935638ab59bc4bb43f748dd84 | 493 | py | Python | createwikimap.py | Srinivas-R/BLINK | 51a932319cc2446843f7907054d9726a3376210e | [
"MIT"
] | null | null | null | createwikimap.py | Srinivas-R/BLINK | 51a932319cc2446843f7907054d9726a3376210e | [
"MIT"
] | null | null | null | createwikimap.py | Srinivas-R/BLINK | 51a932319cc2446843f7907054d9726a3376210e | [
"MIT"
] | null | null | null | import pickle
from tqdm import tqdm
wikimap = {}
with open('page_ids_en.ttl', 'r') as filein:
for line in tqdm(filein, total=16000000):
try:
res, _, pageID, _ = [x.strip() for x in line.split(' ')]
pageID = int(pageID.split('^^')[0].strip('"'))
res = res.strip('<').strip('>')
wikimap[pageID] = res
exc... | 24.65 | 64 | 0.657201 | import pickle
from tqdm import tqdm
wikimap = {}
with open('page_ids_en.ttl', 'r') as filein:
for line in tqdm(filein, total=16000000):
try:
res, _, pageID, _ = [x.strip() for x in line.split(' ')]
pageID = int(pageID.split('^^')[0].strip('"'))
res = res.strip('<').strip('>')
wikimap[pageID] = res
exc... | true | true |
f7509aafc05dc1c45b4269da0c599121e828c69c | 6,318 | py | Python | scripts/update_python.py | akoeplinger/emsdk | 96d7ee1c5e2ce349add36df6165ba7b4ffc96b77 | [
"MIT"
] | null | null | null | scripts/update_python.py | akoeplinger/emsdk | 96d7ee1c5e2ce349add36df6165ba7b4ffc96b77 | [
"MIT"
] | null | null | null | scripts/update_python.py | akoeplinger/emsdk | 96d7ee1c5e2ce349add36df6165ba7b4ffc96b77 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Updates the python binaries that we cache s... | 40.5 | 181 | 0.666667 |
import glob
import multiprocessing
import os
import platform
import urllib.request
import shutil
import subprocess
import sys
from subprocess import check_call
version = '3.9.2'
major_minor_version = '.'.join(version.split('.')[:2])
base = 'https://www.python.org/ftp/python/%s/' % version
revision = '1'
pywi... | true | true |
f7509b648f003ddaaca1b1446b932c15bc5003ef | 327 | py | Python | accounts/api/urls.py | SubhanRzayev/E-commerce-Tmart | 239218397f4ee55ab6ae4ef1798fbc83bc7d1159 | [
"MIT"
] | 2 | 2021-08-13T14:23:34.000Z | 2021-09-18T08:48:29.000Z | accounts/api/urls.py | SubhanRzayev/E-commerce-Tmart | 239218397f4ee55ab6ae4ef1798fbc83bc7d1159 | [
"MIT"
] | null | null | null | accounts/api/urls.py | SubhanRzayev/E-commerce-Tmart | 239218397f4ee55ab6ae4ef1798fbc83bc7d1159 | [
"MIT"
] | null | null | null | from rest_framework import views
from accounts.api.views import *
from django.urls import path
from . import views
from accounts.api.serializer import RegisterSerializer
from accounts.views import RegisterView
app_name = 'accounts'
urlpatterns = [
path('register/', views.RegisterView.as_view(), name='auth_register... | 25.153846 | 74 | 0.788991 | from rest_framework import views
from accounts.api.views import *
from django.urls import path
from . import views
from accounts.api.serializer import RegisterSerializer
from accounts.views import RegisterView
app_name = 'accounts'
urlpatterns = [
path('register/', views.RegisterView.as_view(), name='auth_register... | true | true |
f7509c18049a6df28d17d6c90c30957cf294958c | 6,934 | py | Python | official/cv/ssd/src/box_utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ssd/src/box_utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ssd/src/box_utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 40.549708 | 117 | 0.602682 |
import math
import itertools as it
import numpy as np
from src.model_utils.config import config
from .anchor_generator import GridAnchorGenerator
class GeneratDefaultBoxes():
def __init__(self):
fk = config.img_shape[0] / np.array(config.steps)
scale_rate = (config.max_scale - conf... | true | true |
f7509d786edbaea5116819d280816e3353cd61cd | 685 | py | Python | tests/test_worker_registration.py | agronick/aiogear | 9e4f2d18f05d91daea9e48de18b2d38f4811589f | [
"MIT"
] | null | null | null | tests/test_worker_registration.py | agronick/aiogear | 9e4f2d18f05d91daea9e48de18b2d38f4811589f | [
"MIT"
] | null | null | null | tests/test_worker_registration.py | agronick/aiogear | 9e4f2d18f05d91daea9e48de18b2d38f4811589f | [
"MIT"
] | null | null | null | import pytest
from unittest import mock
from aiogear import Worker, PacketType
@pytest.fixture(scope='function')
def worker():
w = Worker()
w.get_task = mock.Mock()
return w
def test_register_function_connected(worker):
written = None
def _write(data):
nonlocal written
written =... | 23.62069 | 82 | 0.725547 | import pytest
from unittest import mock
from aiogear import Worker, PacketType
@pytest.fixture(scope='function')
def worker():
w = Worker()
w.get_task = mock.Mock()
return w
def test_register_function_connected(worker):
written = None
def _write(data):
nonlocal written
written =... | true | true |
f7509f903f49a97e3b7ba172f876bf3f261dc59c | 410 | py | Python | balanced_news/news/models.py | thearyanmittal/news-aggregator | 2debf78a23a882040c88bcc1facf0087ee30fbfb | [
"Apache-2.0"
] | null | null | null | balanced_news/news/models.py | thearyanmittal/news-aggregator | 2debf78a23a882040c88bcc1facf0087ee30fbfb | [
"Apache-2.0"
] | null | null | null | balanced_news/news/models.py | thearyanmittal/news-aggregator | 2debf78a23a882040c88bcc1facf0087ee30fbfb | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
class Headline(models.Model):
leaning = models.TextField()
title = models.TextField()
img = models.URLField(max_length=1000, null=True, blank=True)
mins_ago = models.IntegerField(default=1440)
time_ago_str = models.TextField(null=True)
url... | 31.538462 | 65 | 0.714634 | from django.db import models
class Headline(models.Model):
leaning = models.TextField()
title = models.TextField()
img = models.URLField(max_length=1000, null=True, blank=True)
mins_ago = models.IntegerField(default=1440)
time_ago_str = models.TextField(null=True)
url = models.URLField(max_len... | true | true |
f7509fb1dace0eaf94060d0a0c5c7f5df324cd9f | 12,761 | py | Python | Fission Reactor Simulator/ReactorGridBlock.py | Klayto-235/GT6-Simulators | f0a1d543945ce5a10f6692e5988a0f2d5638ad90 | [
"MIT"
] | 1 | 2022-03-08T08:32:59.000Z | 2022-03-08T08:32:59.000Z | Fission Reactor Simulator/ReactorGridBlock.py | Klayto-235/GT6-Simulators | f0a1d543945ce5a10f6692e5988a0f2d5638ad90 | [
"MIT"
] | 1 | 2022-02-26T16:22:59.000Z | 2022-02-28T09:31:12.000Z | Fission Reactor Simulator/ReactorGridBlock.py | Klayto-235/GT6-Simulators | f0a1d543945ce5a10f6692e5988a0f2d5638ad90 | [
"MIT"
] | 1 | 2022-01-02T19:55:39.000Z | 2022-01-02T19:55:39.000Z | from json import JSONEncoder
from PyQt6.QtGui import QIcon, QResizeEvent, QColor, QPainter, QBrush, QPen, QFont
from PyQt6.QtWidgets import QGridLayout, QWidget, QSizePolicy, QHBoxLayout, QGraphicsSimpleTextItem, QGraphicsRectItem, QGraphicsPixmapItem
from PyQt6.QtCore import Qt, pyqtSignal, QSize, QRect
from Assets i... | 25.884381 | 139 | 0.69156 | from json import JSONEncoder
from PyQt6.QtGui import QIcon, QResizeEvent, QColor, QPainter, QBrush, QPen, QFont
from PyQt6.QtWidgets import QGridLayout, QWidget, QSizePolicy, QHBoxLayout, QGraphicsSimpleTextItem, QGraphicsRectItem, QGraphicsPixmapItem
from PyQt6.QtCore import Qt, pyqtSignal, QSize, QRect
from Assets i... | true | true |
f7509fb7b4924a4dfb4d3d634da9e473b442044a | 5,356 | py | Python | tests/test_index_functions.py | octoenergy/elasticsearch-django | 4b24fb8bb5729d950c8d56740f8be0acb336de1c | [
"MIT"
] | 87 | 2016-09-04T06:24:04.000Z | 2022-02-01T01:43:47.000Z | tests/test_index_functions.py | octoenergy/elasticsearch-django | 4b24fb8bb5729d950c8d56740f8be0acb336de1c | [
"MIT"
] | 28 | 2016-12-09T22:48:29.000Z | 2021-04-07T11:01:34.000Z | tests/test_index_functions.py | octoenergy/elasticsearch-django | 4b24fb8bb5729d950c8d56740f8be0acb336de1c | [
"MIT"
] | 31 | 2017-01-30T12:31:47.000Z | 2022-02-03T17:22:03.000Z | from unittest import mock
from django.test import TestCase
from elasticsearch_django.index import (
_prune_hit,
bulk_actions,
create_index,
delete_index,
prune_index,
scan_index,
update_index,
)
from .models import ExampleModel, ExampleModelManager
class IndexFunctionTests(TestCase):
... | 38.811594 | 86 | 0.677931 | from unittest import mock
from django.test import TestCase
from elasticsearch_django.index import (
_prune_hit,
bulk_actions,
create_index,
delete_index,
prune_index,
scan_index,
update_index,
)
from .models import ExampleModel, ExampleModelManager
class IndexFunctionTests(TestCase):
... | true | true |
f7509fbe1a8a9ca7f94dfc7b49ef0f8b62166fc7 | 760 | py | Python | stories/migrations/0003_post.py | HamdaniFatima/WorkShop | cd3f682a4d8b1abf3b03f80e96aa50ce5b48062e | [
"bzip2-1.0.6"
] | null | null | null | stories/migrations/0003_post.py | HamdaniFatima/WorkShop | cd3f682a4d8b1abf3b03f80e96aa50ce5b48062e | [
"bzip2-1.0.6"
] | null | null | null | stories/migrations/0003_post.py | HamdaniFatima/WorkShop | cd3f682a4d8b1abf3b03f80e96aa50ce5b48062e | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.7 on 2020-02-28 15:12
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('stories', '0002_auto_20200228_1551'),
]
operations = [
migrations.CreateModel(
name='Post',
... | 30.4 | 114 | 0.593421 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('stories', '0002_auto_20200228_1551'),
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.Aut... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.