hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790aadb441e4de5e6bce99cf2422a6b0a6a9d785 | 3,325 | py | Python | tvsynth/script_train_unet_it_tikh_jitter.py | jmaces/robust-nets | 25d49302f9fa5fcc9ded2727de75e96e25243d09 | [
"MIT"
] | 14 | 2020-11-10T07:37:23.000Z | 2022-03-21T15:19:22.000Z | tvsynth/script_train_unet_it_tikh_jitter.py | jmaces/robust-nets | 25d49302f9fa5fcc9ded2727de75e96e25243d09 | [
"MIT"
] | null | null | null | tvsynth/script_train_unet_it_tikh_jitter.py | jmaces/robust-nets | 25d49302f9fa5fcc9ded2727de75e96e25243d09 | [
"MIT"
] | 2 | 2021-03-13T14:39:36.000Z | 2022-02-17T06:44:29.000Z | import os
import matplotlib as mpl
import torch
from data_management import Jitter, load_dataset
from networks import IterativeNet, UNet
from operators import TVAnalysis, get_tikhonov_matrix
# --- load configuration -----
import config # isort:skip
# ----- general setup -----
mpl.use("agg")
device = torch.device(... | 26.814516 | 77 | 0.616241 | import os
import matplotlib as mpl
import torch
from data_management import Jitter, load_dataset
from networks import IterativeNet, UNet
from operators import TVAnalysis, get_tikhonov_matrix
import config
mpl.use("agg")
device = torch.device("cuda:0")
OpA = config.meas_op(config.m, config.n, device=device, ... | true | true |
790aadc72c81025abce53266b5ee19b90d22938d | 20,731 | py | Python | tests/test_utils.py | sethvargo/datasette | 30e5f0e67c38054a8087a2a4eae3fc4d1779af90 | [
"Apache-2.0"
] | null | null | null | tests/test_utils.py | sethvargo/datasette | 30e5f0e67c38054a8087a2a4eae3fc4d1779af90 | [
"Apache-2.0"
] | null | null | null | tests/test_utils.py | sethvargo/datasette | 30e5f0e67c38054a8087a2a4eae3fc4d1779af90 | [
"Apache-2.0"
] | null | null | null | """
Tests for various datasette helper functions.
"""
from datasette.app import Datasette
from datasette import utils
from datasette.utils.asgi import Request
from datasette.utils.sqlite import sqlite3
import json
import os
import pathlib
import pytest
import tempfile
from unittest.mock import patch
@pytest.mark.para... | 31.74732 | 176 | 0.556268 | from datasette.app import Datasette
from datasette import utils
from datasette.utils.asgi import Request
from datasette.utils.sqlite import sqlite3
import json
import os
import pathlib
import pytest
import tempfile
from unittest.mock import patch
@pytest.mark.parametrize(
"path,expected",
[
("foo", ["... | true | true |
790aae41bd5da16a5e05e117c4ed51e6e62bfed5 | 4,682 | py | Python | basisopt/opt/eventemper.py | robashaw/basisopt | c02fd307bc72c576ed298ea14648818b237d2f30 | [
"MIT"
] | 4 | 2022-03-23T09:22:54.000Z | 2022-03-26T13:18:45.000Z | basisopt/opt/eventemper.py | robashaw/basisopt | c02fd307bc72c576ed298ea14648818b237d2f30 | [
"MIT"
] | null | null | null | basisopt/opt/eventemper.py | robashaw/basisopt | c02fd307bc72c576ed298ea14648818b237d2f30 | [
"MIT"
] | 1 | 2022-03-23T09:22:54.000Z | 2022-03-23T09:22:54.000Z | import numpy as np
from mendeleev import element as md_element
from basisopt import api, data
from basisopt.exceptions import PropertyNotAvailable
from basisopt.basis import even_temper_expansion
from basisopt.basis.guesses import null_guess
from .preconditioners import unit
from .strategies import Strategy
_INITIAL_... | 37.758065 | 89 | 0.566852 | import numpy as np
from mendeleev import element as md_element
from basisopt import api, data
from basisopt.exceptions import PropertyNotAvailable
from basisopt.basis import even_temper_expansion
from basisopt.basis.guesses import null_guess
from .preconditioners import unit
from .strategies import Strategy
_INITIAL_... | true | true |
790aaf424bd9657c1e4b6172ed739772d3cabb0d | 219 | py | Python | profiles_api/admin.py | yash-hash/Profiles-rest-api | 669961dd1a6a557622c6f856101d390a0b944794 | [
"MIT"
] | null | null | null | profiles_api/admin.py | yash-hash/Profiles-rest-api | 669961dd1a6a557622c6f856101d390a0b944794 | [
"MIT"
] | null | null | null | profiles_api/admin.py | yash-hash/Profiles-rest-api | 669961dd1a6a557622c6f856101d390a0b944794 | [
"MIT"
] | null | null | null | from django.contrib import admin
from profiles_api import models
# Register your models here.
admin.site.register(models.UserProfile) # registers the model on the admin site
admin.site.register(models.ProfileFeedItem)
| 31.285714 | 79 | 0.826484 | from django.contrib import admin
from profiles_api import models
admin.site.register(models.UserProfile)
admin.site.register(models.ProfileFeedItem)
| true | true |
790aaf4ad87a1b3d6110aa1152c9fa874d1b4c13 | 1,001 | py | Python | perceptual.py | liuh127/Two-branch-dehazing | 00f7612d38828688123b13323b33d48d08fbd3c0 | [
"MIT"
] | 15 | 2021-04-21T01:19:29.000Z | 2021-08-16T14:34:53.000Z | perceptual.py | sagnik3141/DW-GAN-Dehazing | 2861089977876e2809f094b19dc529200af54f00 | [
"MIT"
] | 6 | 2021-04-22T03:28:04.000Z | 2021-09-21T13:18:06.000Z | perceptual.py | sagnik3141/DW-GAN-Dehazing | 2861089977876e2809f094b19dc529200af54f00 | [
"MIT"
] | 3 | 2021-04-22T16:34:27.000Z | 2021-06-28T06:21:12.000Z | # --- Imports --- #
import torch
import torch.nn.functional as F
# --- Perceptual loss network --- #
class LossNetwork(torch.nn.Module):
def __init__(self, vgg_model):
super(LossNetwork, self).__init__()
self.vgg_layers = vgg_model
self.layer_name_mapping = {
'3': "relu1_2",
... | 33.366667 | 76 | 0.598402 | import torch
import torch.nn.functional as F
class LossNetwork(torch.nn.Module):
def __init__(self, vgg_model):
super(LossNetwork, self).__init__()
self.vgg_layers = vgg_model
self.layer_name_mapping = {
'3': "relu1_2",
'8': "relu2_2",
'15': "relu3_3"
... | true | true |
790ab10c114ed809a1b80f3e101c2509b9257268 | 332 | py | Python | modules/timeblock.py | 5225225/bar | cc72eb45f21ac2b2e070c6d9f66b306ed51aef35 | [
"MIT"
] | 1 | 2015-09-05T17:07:59.000Z | 2015-09-05T17:07:59.000Z | modules/timeblock.py | 5225225/bar | cc72eb45f21ac2b2e070c6d9f66b306ed51aef35 | [
"MIT"
] | null | null | null | modules/timeblock.py | 5225225/bar | cc72eb45f21ac2b2e070c6d9f66b306ed51aef35 | [
"MIT"
] | 2 | 2015-09-05T17:08:02.000Z | 2019-02-22T21:14:08.000Z | import linelib
import datetime
import signal
def handler(x, y):
pass
signal.signal(signal.SIGUSR1, handler)
signal.signal(signal.SIGALRM, handler)
while True:
linelib.sendblock("date", {"full_text": datetime.datetime.now().strftime(
"%Y-%m-%e %H:%M:%S"
)})
linelib.sendPID("date")
linelib... | 18.444444 | 77 | 0.671687 | import linelib
import datetime
import signal
def handler(x, y):
pass
signal.signal(signal.SIGUSR1, handler)
signal.signal(signal.SIGALRM, handler)
while True:
linelib.sendblock("date", {"full_text": datetime.datetime.now().strftime(
"%Y-%m-%e %H:%M:%S"
)})
linelib.sendPID("date")
linelib... | true | true |
790ab1a20b5574df9d37d70dbe96e1b795d53953 | 103 | py | Python | python/learn/base/module/l1/pack/big/b1.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | 2 | 2017-06-07T03:20:42.000Z | 2020-01-07T09:14:26.000Z | python/learn/base/module/l1/pack/big/b1.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | python/learn/base/module/l1/pack/big/b1.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | #!/usr/bin/python2.7
print "run here: pack/big/b1.py"
def b1_fun(): print "function: pack/big/b1.py"
| 17.166667 | 46 | 0.679612 |
print "run here: pack/big/b1.py"
def b1_fun(): print "function: pack/big/b1.py"
| false | true |
790ab21527b6740f6f32ad4c5cfd07ec514bd8ee | 858 | py | Python | src/build_data_source.py | datarootsio/notion-dbs-data-quality | 5d2c03d6754b5b7242d69557803ed40d1c27d29a | [
"MIT"
] | 5 | 2021-12-16T04:54:39.000Z | 2022-03-11T13:49:05.000Z | src/build_data_source.py | datarootsio/notion-dbs-data-quality | 5d2c03d6754b5b7242d69557803ed40d1c27d29a | [
"MIT"
] | null | null | null | src/build_data_source.py | datarootsio/notion-dbs-data-quality | 5d2c03d6754b5b7242d69557803ed40d1c27d29a | [
"MIT"
] | null | null | null | from ruamel import yaml
import great_expectations as ge
if __name__ == "__main__":
context = ge.get_context()
datasource_config = {
"name": "my_notion_pandas_data_source",
"class_name": "Datasource",
"module_name": "great_expectations.datasource",
"execution_engine": {
... | 31.777778 | 78 | 0.630536 | from ruamel import yaml
import great_expectations as ge
if __name__ == "__main__":
context = ge.get_context()
datasource_config = {
"name": "my_notion_pandas_data_source",
"class_name": "Datasource",
"module_name": "great_expectations.datasource",
"execution_engine": {
... | true | true |
790ab284d48ac4a8577668518e214ac28d1d4e82 | 6,649 | py | Python | tests/tests.py | michaelcrain/pdfquery | 89ee378af2e0d97f75d7798ec91a86654b154265 | [
"MIT"
] | 2 | 2017-07-13T19:37:36.000Z | 2021-08-25T04:47:35.000Z | tests/tests.py | michaelcrain/pdfquery | 89ee378af2e0d97f75d7798ec91a86654b154265 | [
"MIT"
] | null | null | null | tests/tests.py | michaelcrain/pdfquery | 89ee378af2e0d97f75d7798ec91a86654b154265 | [
"MIT"
] | null | null | null | # to run:
# pip install unittest2
# unit2 discover
#
# to debug:
# pip install nose
# nosetests --pdb
import StringIO
import sys
import pdfquery
import unittest2
from pdfquery.cache import FileCache
class TestPDFQuery(unittest2.TestCase):
"""
Various tests based on the IRS_1040A sample doc.
"""
... | 34.630208 | 90 | 0.563393 |
import StringIO
import sys
import pdfquery
import unittest2
from pdfquery.cache import FileCache
class TestPDFQuery(unittest2.TestCase):
@classmethod
def setUpClass(cls):
cls.pdf = pdfquery.PDFQuery(
"tests/samples/IRS_1040A.pdf",
parse_tree_cacher=FileCache("/tmp/") ... | true | true |
790ab2b565b507b84e4f23fb2640510b6fe33567 | 1,595 | py | Python | ex3.py | Felipe-Gs/Dupla-2-F | d19854fdc6a3ddc0e59eae99bfff49c20cc434f3 | [
"MIT"
] | 2 | 2021-10-15T18:55:15.000Z | 2022-03-20T02:30:11.000Z | ex3.py | Felipe-Gs/Dupla-2-F | d19854fdc6a3ddc0e59eae99bfff49c20cc434f3 | [
"MIT"
] | null | null | null | ex3.py | Felipe-Gs/Dupla-2-F | d19854fdc6a3ddc0e59eae99bfff49c20cc434f3 | [
"MIT"
] | null | null | null | class Pessoa():
def criar_lista(self, n, id_ade, sexo, saude):
lista = []
qunt = int(input('quantas pessoas são: '))
for c in range(qunt):
n = input('digite seu nome: ')
lista.append(n)
idade = int(input('digite sua idade: '))
while idade ... | 39.875 | 113 | 0.523511 | class Pessoa():
def criar_lista(self, n, id_ade, sexo, saude):
lista = []
qunt = int(input('quantas pessoas são: '))
for c in range(qunt):
n = input('digite seu nome: ')
lista.append(n)
idade = int(input('digite sua idade: '))
while idade ... | true | true |
790ab2e897bf9666d58e716d0b143db895baaf53 | 655 | py | Python | tests/text_classification_nonsync.py | anthliu/turkit2 | f8033d5d5b1be4afe838d5f2f49bff532a656119 | [
"MIT"
] | 1 | 2021-01-18T20:11:04.000Z | 2021-01-18T20:11:04.000Z | tests/text_classification_nonsync.py | anthliu/turkit2 | f8033d5d5b1be4afe838d5f2f49bff532a656119 | [
"MIT"
] | null | null | null | tests/text_classification_nonsync.py | anthliu/turkit2 | f8033d5d5b1be4afe838d5f2f49bff532a656119 | [
"MIT"
] | null | null | null | import uuid
from turkit2.common import TextClassification
from turkit2.qualifications import Unique, Locale, AcceptRate
from utils import get_client
client = get_client()
quals = [Locale(), AcceptRate()]
task = TextClassification(client, 'Test3', '0.01', 'test test', 600, 6000, ['positive', 'negative'], question='Wh... | 26.2 | 190 | 0.700763 | import uuid
from turkit2.common import TextClassification
from turkit2.qualifications import Unique, Locale, AcceptRate
from utils import get_client
client = get_client()
quals = [Locale(), AcceptRate()]
task = TextClassification(client, 'Test3', '0.01', 'test test', 600, 6000, ['positive', 'negative'], question='Wh... | true | true |
790ab2edb90fd0066f6d5b94210ace24210702f9 | 1,289 | py | Python | gwells/models/ScreenIntakeMethodCode.py | fieranmason/gwells | 867d56bbe52343054862c72ac6285058a6556a58 | [
"Apache-2.0"
] | 1 | 2020-01-29T22:42:40.000Z | 2020-01-29T22:42:40.000Z | gwells/models/ScreenIntakeMethodCode.py | fieranmason/gwells | 867d56bbe52343054862c72ac6285058a6556a58 | [
"Apache-2.0"
] | 1 | 2018-05-02T05:28:33.000Z | 2018-05-09T15:58:07.000Z | gwells/models/ScreenIntakeMethodCode.py | fieranmason/gwells | 867d56bbe52343054862c72ac6285058a6556a58 | [
"Apache-2.0"
] | 1 | 2018-05-02T23:56:48.000Z | 2018-05-02T23:56:48.000Z | """
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, software
distri... | 37.911765 | 102 | 0.728472 | from .AuditModel import AuditModel
from django.db import models
class ScreenIntakeMethodCode(AuditModel):
screen_intake_code = models.CharField(primary_key=True, max_length=10, editable=False)
description = models.CharField(max_length=100)
display_order = models.PositiveIntegerField()
effective_date =... | true | true |
790ab3a508398cd01d952faf3eef6c96f6f2fb18 | 26,681 | py | Python | pysnmp/ASCEND-MIBSYS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ASCEND-MIBSYS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ASCEND-MIBSYS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ASCEND-MIBSYS1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBSYS1-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:12:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... | 175.532895 | 4,174 | 0.793973 |
configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration")
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ... | true | true |
790ab49fa3eb6a146fbbcdcd2af46fefaf17821d | 24,781 | py | Python | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 30 | 2020-06-19T06:42:50.000Z | 2021-08-23T21:16:36.000Z | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 25 | 2021-08-30T01:17:27.000Z | 2022-03-16T14:10:14.000Z | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 23 | 2020-07-06T13:41:54.000Z | 2021-08-23T21:04:50.000Z | # coding: utf-8
"""
ThingsBoard REST API
ThingsBoard Professional Edition IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.3.3PAAS-RC1
Contact: info@thingsboard.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_impo... | 47.564299 | 824 | 0.655179 |
from __future__ import absolute_import
import re
import six
from tb_rest_client.api_client import ApiClient
class WidgetsBundleControllerApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def del... | true | true |
790ab4eb85e8bcfb94fe52b0ec8e99e61f4cf09f | 667 | py | Python | setup.py | Shimwell/inference-tools | 755b68bcf2e8c40414f4379afd80c2d7574583ed | [
"MIT"
] | null | null | null | setup.py | Shimwell/inference-tools | 755b68bcf2e8c40414f4379afd80c2d7574583ed | [
"MIT"
] | null | null | null | setup.py | Shimwell/inference-tools | 755b68bcf2e8c40414f4379afd80c2d7574583ed | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="inference-tools",
version="0.5.2",
author="Chris Bowman",
author_email="chris.bowman.physics@gmail.com",
description="A collection of python tools for Bayesian data analysis... | 31.761905 | 74 | 0.677661 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="inference-tools",
version="0.5.2",
author="Chris Bowman",
author_email="chris.bowman.physics@gmail.com",
description="A collection of python tools for Bayesian data analysis... | true | true |
790ab52c56461635760ab79d3119898270aad495 | 55,099 | py | Python | release/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py | naetherm/Bforartists | 4d78856b76544b9eeb49e7dd388b4cf41d58d7e4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2019-09-16T10:29:19.000Z | 2022-02-11T14:43:18.000Z | release/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py | naetherm/Bforartists | 4d78856b76544b9eeb49e7dd388b4cf41d58d7e4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py | naetherm/Bforartists | 4d78856b76544b9eeb49e7dd388b4cf41d58d7e4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright 2018-2019 The glTF-Blender-IO authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 45.877602 | 120 | 0.629993 |
import sys
import traceback
from io_scene_gltf2.io.com import gltf2_io_debug
def from_int(x):
assert isinstance(x, int) and not isinstance(x, bool)
return x
def from_none(x):
assert x is None
return x
def from_union(fs, x):
tracebacks = []
for f in fs:
try:
... | true | true |
790ab56e397cbd847361a9ed6c5e792aaeed171e | 3,047 | py | Python | vehicle_tracker/visual.py | mondrasovic/multi_object_tracking_demo | d4ec6af4e3bca9d47628358967a05890071407ee | [
"MIT"
] | null | null | null | vehicle_tracker/visual.py | mondrasovic/multi_object_tracking_demo | d4ec6af4e3bca9d47628358967a05890071407ee | [
"MIT"
] | null | null | null | vehicle_tracker/visual.py | mondrasovic/multi_object_tracking_demo | d4ec6af4e3bca9d47628358967a05890071407ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Milan Ondrasovic <milan.ondrasovic@gmail.com>
import random
from typing import Sequence, Tuple, Dict, cast
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
from tracking import TrackedDetection
ColorT = Tuple[int, int, int]
PointT = Tuple[... | 34.235955 | 80 | 0.644568 |
import random
from typing import Sequence, Tuple, Dict, cast
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
from tracking import TrackedDetection
ColorT = Tuple[int, int, int]
PointT = Tuple[int, int]
def labeled_rectangle(
image: np.ndarray, start_point: PointT, end_point: Point... | true | true |
790ab5f854de84d04e04ba888f76a7c8528ef2a9 | 12,970 | py | Python | preliminary_contest/nezha_pretrain/tokenization.py | YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3 | a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f | [
"Apache-2.0"
] | 22 | 2021-06-04T13:01:08.000Z | 2022-02-18T13:19:46.000Z | preliminary_contest/nezha_pretrain/tokenization.py | YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3 | a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f | [
"Apache-2.0"
] | null | null | null | preliminary_contest/nezha_pretrain/tokenization.py | YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3 | a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f | [
"Apache-2.0"
] | 2 | 2021-06-06T09:41:08.000Z | 2021-06-09T01:05:10.000Z | # coding=utf-8
"""Tokenization classes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import unicodedata
import six
import tensorflow as tf
import re
import warnings
warnings.filterwarnings('ignore')
def validate_case_matches_checkp... | 33.427835 | 84 | 0.590902 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import unicodedata
import six
import tensorflow as tf
import re
import warnings
warnings.filterwarnings('ignore')
def validate_case_matches_checkpoint(do_lower_case, init_checkpoint):
... | true | true |
790ab6072cf551b86578de970ab717b64acd034b | 717 | py | Python | rpython/jit/backend/arm/test/test_ztranslation_external_exception.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/jit/backend/arm/test/test_ztranslation_external_exception.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/jit/backend/arm/test/test_ztranslation_external_exception.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | from rpython.jit.backend.llsupport.test.ztranslation_test import TranslationRemoveTypePtrTest
from rpython.translator.translator import TranslationContext
from rpython.config.translationoption import DEFL_GC
from rpython.jit.backend.arm.test.support import skip_unless_run_slow_tests
skip_unless_run_slow_tests()
class... | 47.8 | 93 | 0.797768 | from rpython.jit.backend.llsupport.test.ztranslation_test import TranslationRemoveTypePtrTest
from rpython.translator.translator import TranslationContext
from rpython.config.translationoption import DEFL_GC
from rpython.jit.backend.arm.test.support import skip_unless_run_slow_tests
skip_unless_run_slow_tests()
class... | true | true |
790ab627a508221249228239edbb5d8c2e7c1a25 | 10,628 | py | Python | src/model/lstm_crf/main.py | vikasbahirwani/SequenceTagging | b4e0dc2a71f869a27ada003c9276fd1f269e230d | [
"Apache-2.0"
] | null | null | null | src/model/lstm_crf/main.py | vikasbahirwani/SequenceTagging | b4e0dc2a71f869a27ada003c9276fd1f269e230d | [
"Apache-2.0"
] | null | null | null | src/model/lstm_crf/main.py | vikasbahirwani/SequenceTagging | b4e0dc2a71f869a27ada003c9276fd1f269e230d | [
"Apache-2.0"
] | null | null | null | # reimplementation of https://github.com/guillaumegenthial/tf_ner/blob/master/models/lstm_crf/main.py
import functools
import json
import logging
from pathlib import Path
import sys
import numpy as np
import tensorflow as tf
# tf.enable_eager_execution()
from tf_metrics import precision, recall, f1
DATADIR = "../../.... | 38.647273 | 142 | 0.691664 |
import functools
import json
import logging
from pathlib import Path
import sys
import numpy as np
import tensorflow as tf
from tf_metrics import precision, recall, f1
DATADIR = "../../../data/conll/"
Path('results').mkdir(exist_ok=True)
tf.logging.set_verbosity(logging.INFO)
handlers = [ logging.FileHandler('res... | true | true |
790ab6b54ec2b2575ba95b4db6a86451e8773e78 | 8,145 | py | Python | tinygrad/ops_cpu.py | dredwardhyde/tinygrad-universal | aeb28fc42fb40e9848613ce81811a727fee6f313 | [
"Apache-2.0"
] | 1 | 2021-02-24T17:38:03.000Z | 2021-02-24T17:38:03.000Z | tinygrad/ops_cpu.py | dredwardhyde/tinygrad-universal | aeb28fc42fb40e9848613ce81811a727fee6f313 | [
"Apache-2.0"
] | null | null | null | tinygrad/ops_cpu.py | dredwardhyde/tinygrad-universal | aeb28fc42fb40e9848613ce81811a727fee6f313 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .tensor import Function
# ************* unary ops *************
class ReLU(Function):
@staticmethod
def forward(ctx, input):
ctx.save_for_backward(input)
return np.maximum(input, 0)
@staticmethod
def backward(ctx, grad_output):
input, = ctx.saved_tens... | 32.193676 | 117 | 0.570166 | import numpy as np
from .tensor import Function
class ReLU(Function):
@staticmethod
def forward(ctx, input):
ctx.save_for_backward(input)
return np.maximum(input, 0)
@staticmethod
def backward(ctx, grad_output):
input, = ctx.saved_tensors
return grad_output * (input... | true | true |
790ab7ee606d609170fba5d1c33ff6a2d559bc20 | 36,190 | py | Python | Lib/test/test_tracemalloc.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 486 | 2016-05-28T18:51:54.000Z | 2022-03-20T17:30:31.000Z | Lib/test/test_tracemalloc.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 40 | 2016-05-29T00:24:56.000Z | 2020-07-13T11:56:58.000Z | Lib/test/test_tracemalloc.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 46 | 2016-05-28T18:52:03.000Z | 2021-06-01T07:57:51.000Z | import contextlib
import os
import sys
import tracemalloc
import unittest
from unittest.mock import patch
from test.support.script_helper import (assert_python_ok, assert_python_failure,
interpreter_requires_environment)
from test import support
try:
import threading
except I... | 36.408451 | 104 | 0.593645 | import contextlib
import os
import sys
import tracemalloc
import unittest
from unittest.mock import patch
from test.support.script_helper import (assert_python_ok, assert_python_failure,
interpreter_requires_environment)
from test import support
try:
import threading
except I... | true | true |
790ab8bc8dcaac92b2ae1d09617b8388b07d33b3 | 2,018 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/es/models/InstanceSpec.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/es/models/InstanceSpec.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/es/models/InstanceSpec.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 42.041667 | 185 | 0.715064 |
class InstanceSpec(object):
def __init__(self, vpcId, subnetId, instanceVersion, instanceName, azId, instanceClass, ipVersion=None, dedicatedMaster=None, coordinating=None, autoSnapshot=None, authConfig=None):
self.vpcId = vpcId
self.subnetId = subnetId
self.instanceVers... | true | true |
790ab8c88ba983389d8844cf3bf1ef391001f6d7 | 4,328 | py | Python | pip/appdirs.py | chadrik/pip | 178809d5cc6fc4054d34f3ac955f7f13cd8c5759 | [
"MIT"
] | 1 | 2015-11-05T17:33:21.000Z | 2015-11-05T17:33:21.000Z | pip/appdirs.py | chadrik/pip | 178809d5cc6fc4054d34f3ac955f7f13cd8c5759 | [
"MIT"
] | null | null | null | pip/appdirs.py | chadrik/pip | 178809d5cc6fc4054d34f3ac955f7f13cd8c5759 | [
"MIT"
] | null | null | null | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suite our purposes.
"""
import os
import sys
from pip._vendor import six
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this application.
"appname" is the name of application.
... | 31.136691 | 78 | 0.647874 | import os
import sys
from pip._vendor import six
def user_cache_dir(appname):
if sys.platform == "win32":
path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA"))
path = os.path.join(path, appname, "Cache")
elif sys.platform == "darwin":
path = os.pa... | true | true |
790ab8f40190164a4a14f22dd2da155187441626 | 104,192 | py | Python | apps/dash-web-trader/env/Lib/site-packages/plotly/graph_objs/scattergeo/__init__.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | 2 | 2019-10-23T08:14:26.000Z | 2019-10-23T08:14:27.000Z | apps/dash-web-trader/env/Lib/site-packages/plotly/graph_objs/scattergeo/__init__.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | null | null | null | apps/dash-web-trader/env/Lib/site-packages/plotly/graph_objs/scattergeo/__init__.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | 1 | 2021-02-02T02:56:39.000Z | 2021-02-02T02:56:39.000Z |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# marker
# ------
@property
def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
... | 37.224723 | 85 | 0.552 |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
@property
def marker(self):
return self['marker']
@marker.setter
def marker(self, val):
self['marker'] = val
@... | true | true |
790ab9099d3a1dd7e34516750d342d20748bda90 | 3,284 | py | Python | configure_new.py | dodo325/demo-allauth-bootstrap-ru | 28d340a07fdd7a118664818bd8c4399190ca9aee | [
"MIT"
] | null | null | null | configure_new.py | dodo325/demo-allauth-bootstrap-ru | 28d340a07fdd7a118664818bd8c4399190ca9aee | [
"MIT"
] | null | null | null | configure_new.py | dodo325/demo-allauth-bootstrap-ru | 28d340a07fdd7a118664818bd8c4399190ca9aee | [
"MIT"
] | null | null | null | #!/bin/env
"""
Help new users configure the database for use with social networks.
"""
import os
from datetime import datetime
# Fix Python 2.x.
try:
input = raw_input
except NameError:
pass
import django
from django.conf import settings
from django.core.management.utils import get_random_secret_key
BASE_DI... | 26.699187 | 101 | 0.624848 |
import os
from datetime import datetime
try:
input = raw_input
except NameError:
pass
import django
from django.conf import settings
from django.core.management.utils import get_random_secret_key
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
settings.configure(
DEBUG=True,
TEMPLATES=[dict... | true | true |
790ab98b6a5fd4c3f06fcad8822de70fcfb9f51b | 209 | py | Python | frappe/website/doctype/web_page_block/web_page_block.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | 3,755 | 2015-01-06T07:47:43.000Z | 2022-03-31T20:54:23.000Z | frappe/website/doctype/web_page_block/web_page_block.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | 7,369 | 2015-01-01T19:59:41.000Z | 2022-03-31T23:02:05.000Z | frappe/website/doctype/web_page_block/web_page_block.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | 2,685 | 2015-01-07T17:51:03.000Z | 2022-03-31T23:16:24.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# License: MIT. See LICENSE
# import frappe
from frappe.model.document import Document
class WebPageBlock(Document):
pass
| 19 | 58 | 0.741627 |
from frappe.model.document import Document
class WebPageBlock(Document):
pass
| true | true |
790aba6956f1484ca4eca4a8f264f1b3c24bef28 | 9,534 | py | Python | adminfilter/forms.py | COEXCZ/django-adminfilter | d66f6a3c5294156c01db1cf1927942f7cb31119a | [
"0BSD"
] | 3 | 2015-11-17T15:32:02.000Z | 2021-08-06T16:16:04.000Z | adminfilter/forms.py | COEXCZ/django-adminfilter | d66f6a3c5294156c01db1cf1927942f7cb31119a | [
"0BSD"
] | null | null | null | adminfilter/forms.py | COEXCZ/django-adminfilter | d66f6a3c5294156c01db1cf1927942f7cb31119a | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
from copy import deepcopy
from django import forms
from django.conf import settings
from django.core import urlresolvers
from django.db.models import Q, Model
from django.forms.forms import BoundField
from django.forms.util import ErrorDict
from django.utils.http import urlencode
from django.ut... | 29.700935 | 102 | 0.577407 |
from copy import deepcopy
from django import forms
from django.conf import settings
from django.core import urlresolvers
from django.db.models import Q, Model
from django.forms.forms import BoundField
from django.forms.util import ErrorDict
from django.utils.http import urlencode
from django.utils.translation import ... | true | true |
790abc34b87ceed8e9dbc2c1d5b05a111c067b4f | 889 | py | Python | ooobuild/dyn/configuration/backend/multi_layer_stratum.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/configuration/backend/multi_layer_stratum.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/configuration/backend/multi_layer_stratum.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 34.192308 | 99 | 0.767154 |
from ....lo.configuration.backend.multi_layer_stratum import MultiLayerStratum as MultiLayerStratum
__all__ = ['MultiLayerStratum']
| true | true |
790abcb02e5541a1eb9af556ddb6d7a8f9ac2ed7 | 3,155 | py | Python | extensions/rich_text_components/Video/Video.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | 3 | 2015-03-17T01:34:14.000Z | 2015-04-11T10:35:53.000Z | extensions/rich_text_components/Video/Video.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | null | null | null | extensions/rich_text_components/Video/Video.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 36.686047 | 79 | 0.675436 |
from extensions.rich_text_components import base
NONNEGATIVE_INT_SCHEMA = {
'type': 'int',
'validators': [{
'id': 'is_at_least',
'min_value': 0
}],
}
class Video(base.BaseRichTextComponent):
name = 'Video'
category = 'Basic Input'
description = 'A YouTube vid... | true | true |
790abcfda02d081c46add1dfe3f1280ee73eed22 | 3,078 | py | Python | bokeh/models/__init__.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | null | null | null | bokeh/models/__init__.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | null | null | null | bokeh/models/__init__.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 36.642857 | 78 | 0.445094 |
from __future__ import annotations
import logging
log = logging.getLogger(__name__)
from ..core.property.dataspec import expr, field, value
from ..model import Model
from .annotations import *
from .axes import *
from .callbacks import *
from .canvas import *
from .expressions import *
from .filt... | true | true |
790abd468c1c9305c2b9c40a99de30e2e4abee0f | 4,916 | py | Python | brainframe/cli/docker_compose.py | aotuai/brainframe_cli | dcc33494cf3be042ae697ff2c7377e8632ba4132 | [
"BSD-3-Clause"
] | 3 | 2020-06-16T17:57:26.000Z | 2020-12-02T00:19:22.000Z | brainframe/cli/docker_compose.py | aotuai/brainframe_cli | dcc33494cf3be042ae697ff2c7377e8632ba4132 | [
"BSD-3-Clause"
] | 13 | 2020-07-02T17:06:36.000Z | 2020-12-10T21:16:17.000Z | brainframe/cli/docker_compose.py | aotuai/brainframe_cli | dcc33494cf3be042ae697ff2c7377e8632ba4132 | [
"BSD-3-Clause"
] | 1 | 2021-02-18T07:28:11.000Z | 2021-02-18T07:28:11.000Z | import os
import sys
from pathlib import Path
from typing import List, Optional, Tuple
import i18n
import requests
import yaml
from . import config, frozen_utils, os_utils, print_utils
# The URL to the docker-compose.yml
BRAINFRAME_DOCKER_COMPOSE_URL = "https://{subdomain}aotu.ai/releases/brainframe/{version}/docker... | 31.716129 | 109 | 0.672091 | import os
import sys
from pathlib import Path
from typing import List, Optional, Tuple
import i18n
import requests
import yaml
from . import config, frozen_utils, os_utils, print_utils
BRAINFRAME_DOCKER_COMPOSE_URL = "https://{subdomain}aotu.ai/releases/brainframe/{version}/docker-compose.yml"
BRAINFRAME_LATEST_T... | true | true |
790abed0413cd2460b7033477a36bfbdec078f2d | 10,432 | py | Python | tests/linen/linen_linear_test.py | pschuh/flax | 9eee5149f345bd871555f3b53e3605f58588c883 | [
"Apache-2.0"
] | null | null | null | tests/linen/linen_linear_test.py | pschuh/flax | 9eee5149f345bd871555f3b53e3605f58588c883 | [
"Apache-2.0"
] | null | null | null | tests/linen/linen_linear_test.py | pschuh/flax | 9eee5149f345bd871555f3b53e3605f58588c883 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 34.315789 | 86 | 0.592216 |
import functools
from absl.testing import absltest
from absl.testing import parameterized
from flax import linen as nn
import jax
from jax import random
from jax.nn import initializers
import jax.numpy as jnp
import numpy as np
jax.config.parse_flags_with_absl()
class LinearTest(parameterized.Tes... | true | true |
790abef3c00251911fcf64fdfc777b33ae51dfda | 104,740 | py | Python | python/pyspark/pandas/generic.py | XpressAI/spark | 0a838dcd71c733289e60d9f74e8267027c7b2c4a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2018-10-29T08:46:46.000Z | 2018-10-29T08:46:46.000Z | python/pyspark/pandas/generic.py | XpressAI/spark | 0a838dcd71c733289e60d9f74e8267027c7b2c4a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-10-09T22:28:49.000Z | 2019-12-20T00:07:37.000Z | python/pyspark/pandas/generic.py | XpressAI/spark | 0a838dcd71c733289e60d9f74e8267027c7b2c4a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 32.721025 | 100 | 0.527 |
from abc import ABCMeta, abstractmethod
from collections import Counter
from distutils.version import LooseVersion
from functools import reduce
from typing import (
Any,
Callable,
Iterable,
IO,
List,
Optional,
NoReturn,
Tuple,
Union,
TYPE_CHECKING,
cast,
)
im... | true | true |
790abf3e3611e1305d1c69b0dae9c34af032cefe | 44,179 | py | Python | pysnmp-with-texts/ADIC-INTELLIGENT-STORAGE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/ADIC-INTELLIGENT-STORAGE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/ADIC-INTELLIGENT-STORAGE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ADIC-INTELLIGENT-STORAGE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ADIC-INTELLIGENT-STORAGE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:13:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | 123.405028 | 4,464 | 0.774735 |
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuild... | true | true |
790abf5c731926a9cb18395576cca3e79e472422 | 1,001 | py | Python | 06-sistemaLinear/sistemaLinear_v11/teste/testeCores/cores2.py | jonasht/python | 68cf6bd7e27d71a104917d402bbd443afb82810d | [
"MIT"
] | null | null | null | 06-sistemaLinear/sistemaLinear_v11/teste/testeCores/cores2.py | jonasht/python | 68cf6bd7e27d71a104917d402bbd443afb82810d | [
"MIT"
] | null | null | null | 06-sistemaLinear/sistemaLinear_v11/teste/testeCores/cores2.py | jonasht/python | 68cf6bd7e27d71a104917d402bbd443afb82810d | [
"MIT"
] | null | null | null | import imp
from tkinter import *
from sys import exit
from teste.testeCores.corFunc import formatar
conta2x2 = 'x2y=5\n3x-5y=4'
root = Tk()
text = Text(root, width=20, height=10)
text.config(font='arial 20 bold')
text.insert(END, conta2x2)
text.pack()
def q_evento(event):
exit()
root.bind('q', q_evento)
cs = cont... | 21.76087 | 63 | 0.656344 | import imp
from tkinter import *
from sys import exit
from teste.testeCores.corFunc import formatar
conta2x2 = 'x2y=5\n3x-5y=4'
root = Tk()
text = Text(root, width=20, height=10)
text.config(font='arial 20 bold')
text.insert(END, conta2x2)
text.pack()
def q_evento(event):
exit()
root.bind('q', q_evento)
cs = cont... | true | true |
790abf682a8b8ee8b95980765c04ff7227a1992d | 7,173 | py | Python | test/expected/python.asyncio/service_extension_same_file/f_Pinger.py | trevorackerman-wk/frugal | 960f87b581d21a69dc889bcfb526ea3929acac22 | [
"Apache-2.0"
] | null | null | null | test/expected/python.asyncio/service_extension_same_file/f_Pinger.py | trevorackerman-wk/frugal | 960f87b581d21a69dc889bcfb526ea3929acac22 | [
"Apache-2.0"
] | null | null | null | test/expected/python.asyncio/service_extension_same_file/f_Pinger.py | trevorackerman-wk/frugal | 960f87b581d21a69dc889bcfb526ea3929acac22 | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Frugal Compiler (3.4.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
import asyncio
from datetime import timedelta
import inspect
from frugal.aio.processor import FBaseProcessor
from frugal.aio.processor import FProcessorFunction
from frugal.exceptions import TApplicat... | 31.599119 | 147 | 0.626516 |
import asyncio
from datetime import timedelta
import inspect
from frugal.aio.processor import FBaseProcessor
from frugal.aio.processor import FProcessorFunction
from frugal.exceptions import TApplicationExceptionType
from frugal.exceptions import TTransportExceptionType
from frugal.middleware import Method
fro... | true | true |
790ac1baf35d3683f9b9d8baab2ab05ad107a599 | 542 | py | Python | app.py | risatino/seadogz | 182bee6944726477fdae195cf2446a6fedbb9c5b | [
"MIT"
] | null | null | null | app.py | risatino/seadogz | 182bee6944726477fdae195cf2446a6fedbb9c5b | [
"MIT"
] | 7 | 2018-07-03T00:33:42.000Z | 2018-07-24T20:41:49.000Z | app.py | risatino/seadogz | 182bee6944726477fdae195cf2446a6fedbb9c5b | [
"MIT"
] | null | null | null | #####################
# IMPORT DEPENDENCIES
######################
# flask (server)
from flask import(
Flask,
render_template,
jsonify,
request,
redirect)
#######################
# FLASK SET-UP
#######################
app = Flask(__name__)
#######################
# FLASK ROUTES
###############... | 17.483871 | 45 | 0.479705 | true | true | |
790ac599f474e066c512043357817061f888ef0b | 2,411 | py | Python | plugins/CropPermutations/__init__.py | spongezhang/maskgen | 7284e300d1cb326a5349879de0bace9cfa8788a8 | [
"BSD-3-Clause"
] | null | null | null | plugins/CropPermutations/__init__.py | spongezhang/maskgen | 7284e300d1cb326a5349879de0bace9cfa8788a8 | [
"BSD-3-Clause"
] | null | null | null | plugins/CropPermutations/__init__.py | spongezhang/maskgen | 7284e300d1cb326a5349879de0bace9cfa8788a8 | [
"BSD-3-Clause"
] | null | null | null | from PIL import Image
import numpy
from random import randint
"""
A plugin used to create a set of variable spefications for permutation groups.
"""
def transform(img,source,target,**kwargs):
cv_image = numpy.array(img)
shape = cv_image.shape
snapto8 = 'eightbit_boundary' in kwargs and kwargs['eightbit_b... | 48.22 | 115 | 0.608461 | from PIL import Image
import numpy
from random import randint
def transform(img,source,target,**kwargs):
cv_image = numpy.array(img)
shape = cv_image.shape
snapto8 = 'eightbit_boundary' in kwargs and kwargs['eightbit_boundary'] == 'yes'
percentageWidth = float(kwargs['percentage_width'])
percenta... | true | true |
790ac7e4c90ececf45e05b807d65b4c67a3baee7 | 29,340 | py | Python | beta_nmf_minibatch.py | dasmy/minibatchNMF | f7f910e290103c26e2925426849f8bfbe75ba242 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | beta_nmf_minibatch.py | dasmy/minibatchNMF | f7f910e290103c26e2925426849f8bfbe75ba242 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | beta_nmf_minibatch.py | dasmy/minibatchNMF | f7f910e290103c26e2925426849f8bfbe75ba242 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # -*- coding: utf-8 -*-
"""
beta\_nmf_minibatch.py
~~~~~~~~~~~
.. topic:: Contents
The beta_nmf_minibatch module includes the betaNMF class,
fit function and theano functions to compute updates and cost.
Copyright 2014-2016 Romain Serizel
This software is distributed under the terms of the GNU Public L... | 41.499293 | 90 | 0.496455 |
import time
import numpy as np
import theano
import base
import theano.tensor as T
import updates
import costs
class BetaNMF(object):
def __init__(self, data_shape, n_components=50, beta=2, n_iter=50,
fixed_factors=None, cache1_size=0,
batch_size=100, verbose=0,
... | true | true |
790ac88d2bd437731fe4d384f1d233e0b0a71dc3 | 840 | py | Python | recorder.py | udham2511/Python-Screen-Recorder | 419be068398f15128f1279bd68a64c285b60493b | [
"Apache-2.0"
] | 2 | 2022-01-03T06:51:28.000Z | 2022-01-11T19:52:27.000Z | recorder.py | udham2511/Python-Screen-Recorder | 419be068398f15128f1279bd68a64c285b60493b | [
"Apache-2.0"
] | null | null | null | recorder.py | udham2511/Python-Screen-Recorder | 419be068398f15128f1279bd68a64c285b60493b | [
"Apache-2.0"
] | null | null | null | from PIL import ImageGrab
import pyautogui
import numpy
import time
import cv2
import os
timeA = time.time()
fourcc = cv2.VideoWriter_fourcc(*"XVID")
name = f"Recording{len(os.listdir())-2}.mp4"
out = cv2.VideoWriter(name, fourcc, 14.0, (1920, 1080))
white = (255, 255, 255)
black = (0, 0, 0)
while T... | 22.702703 | 59 | 0.608333 | from PIL import ImageGrab
import pyautogui
import numpy
import time
import cv2
import os
timeA = time.time()
fourcc = cv2.VideoWriter_fourcc(*"XVID")
name = f"Recording{len(os.listdir())-2}.mp4"
out = cv2.VideoWriter(name, fourcc, 14.0, (1920, 1080))
white = (255, 255, 255)
black = (0, 0, 0)
while T... | true | true |
790ac899051a5188dd166c227a75f5f75a40e178 | 3,137 | py | Python | Details/models.py | iamcaro/SMA-Team-2 | bc069ed1d11b2fa777d1a3459cc97d276af6ece7 | [
"MIT"
] | null | null | null | Details/models.py | iamcaro/SMA-Team-2 | bc069ed1d11b2fa777d1a3459cc97d276af6ece7 | [
"MIT"
] | 1 | 2021-07-27T22:28:54.000Z | 2021-07-27T22:28:54.000Z | Details/models.py | iamcaro/SMA-Team-2 | bc069ed1d11b2fa777d1a3459cc97d276af6ece7 | [
"MIT"
] | 9 | 2021-07-12T22:34:19.000Z | 2021-07-30T03:11:44.000Z | from django.db import models
from django.conf import settings
# Create your models here.
class Message(models.Model):
id = models.AutoField(primary_key=True)
sender_id = models.ForeignKey(settings.AUTH_USER_MODEL, related_name="message_sender", on_delete=models.DO_NOTHING, null=True)
receiver_id = model... | 35.247191 | 134 | 0.739241 | from django.db import models
from django.conf import settings
class Message(models.Model):
id = models.AutoField(primary_key=True)
sender_id = models.ForeignKey(settings.AUTH_USER_MODEL, related_name="message_sender", on_delete=models.DO_NOTHING, null=True)
receiver_id = models.ForeignKey(settings.AUTH... | true | true |
790ac8ba6876ddb2295dafc87e0c68181c282302 | 3,657 | py | Python | commerce/migrations/0001_initial.py | PragmaticMates/django-commerce | b992bf4c81ca6dfaad9ccd423d25fba9d255f159 | [
"Apache-2.0"
] | 4 | 2017-09-08T19:22:19.000Z | 2021-12-21T17:55:29.000Z | commerce/migrations/0001_initial.py | PragmaticMates/django-commerce | b992bf4c81ca6dfaad9ccd423d25fba9d255f159 | [
"Apache-2.0"
] | null | null | null | commerce/migrations/0001_initial.py | PragmaticMates/django-commerce | b992bf4c81ca6dfaad9ccd423d25fba9d255f159 | [
"Apache-2.0"
] | 1 | 2021-10-31T06:31:18.000Z | 2021-10-31T06:31:18.000Z | # Generated by Django 2.2.4 on 2020-06-25 17:17
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import internationalflavor.countries.models
import internationalflavor.vat_number.models
class Migration(migrations.Migration):
initial = True
dependenc... | 56.261538 | 128 | 0.637134 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import internationalflavor.countries.models
import internationalflavor.vat_number.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_c... | true | true |
790aca15ae84ba5cc89541b8f434209f0a6479f9 | 773 | py | Python | hackernews/hackernews/urls.py | Saltiest-Hacker-News-Trolls-2/DS | aaef46dcb225d0be15f65fc34f97c1734c1c64e9 | [
"MIT"
] | 1 | 2019-11-23T06:56:11.000Z | 2019-11-23T06:56:11.000Z | hackernews/hackernews/urls.py | Saltiest-Hacker-News-Trolls-2/DS | aaef46dcb225d0be15f65fc34f97c1734c1c64e9 | [
"MIT"
] | 10 | 2020-03-24T17:50:51.000Z | 2022-02-09T23:33:10.000Z | hackernews/hackernews/urls.py | Saltiest-Hacker-News-Trolls-2/DS | aaef46dcb225d0be15f65fc34f97c1734c1c64e9 | [
"MIT"
] | 1 | 2019-11-20T06:18:27.000Z | 2019-11-20T06:18:27.000Z | """hackernews URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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')
... | 35.136364 | 78 | 0.690815 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
790aca83da71a12360818a5b285719c722b18eab | 16,025 | py | Python | ironic/dhcp/neutron.py | overcastcloud/ironic | c6608e97af33f8d7f3fe2f7deeb78f52196f2cc7 | [
"Apache-2.0"
] | null | null | null | ironic/dhcp/neutron.py | overcastcloud/ironic | c6608e97af33f8d7f3fe2f7deeb78f52196f2cc7 | [
"Apache-2.0"
] | null | null | null | ironic/dhcp/neutron.py | overcastcloud/ironic | c6608e97af33f8d7f3fe2f7deeb78f52196f2cc7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2014 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 42.060367 | 97 | 0.582652 |
import time
from neutronclient.common import exceptions as neutron_client_exc
from neutronclient.v2_0 import client as clientv20
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import netutils
from ironic.common import exception
from ironic.common.i18n import _
from iro... | true | true |
790acb10e43773f3fb0e4f6ad569629a1d8d7ce4 | 173 | py | Python | sarada/__init__.py | wikii122/sarada | 6e156cce90d6468cce80312f83c3708ad9ca8f6b | [
"MIT"
] | null | null | null | sarada/__init__.py | wikii122/sarada | 6e156cce90d6468cce80312f83c3708ad9ca8f6b | [
"MIT"
] | 16 | 2021-12-03T14:29:39.000Z | 2021-12-28T09:38:15.000Z | sarada/__init__.py | wikii122/sarada | 6e156cce90d6468cce80312f83c3708ad9ca8f6b | [
"MIT"
] | null | null | null | """
A small utility aiming to create programatically sound.
"""
from __future__ import annotations
from importlib import metadata
__version__ = metadata.version("sarada")
| 19.222222 | 55 | 0.791908 | from __future__ import annotations
from importlib import metadata
__version__ = metadata.version("sarada")
| true | true |
790acb8bf4b67c5a3f492e5ec2b57345dc0e8614 | 18,147 | py | Python | antlir/btrfs_diff/extents_to_chunks.py | SaurabhAgarwala/antlir | d9513d35d3eaa9d28717a40057a14d099c6ec775 | [
"MIT"
] | null | null | null | antlir/btrfs_diff/extents_to_chunks.py | SaurabhAgarwala/antlir | d9513d35d3eaa9d28717a40057a14d099c6ec775 | [
"MIT"
] | null | null | null | antlir/btrfs_diff/extents_to_chunks.py | SaurabhAgarwala/antlir | d9513d35d3eaa9d28717a40057a14d099c6ec775 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
One of the trickier parts of creating a mock btrfs filesystem is tracking
the structures of the write forks, respec... | 43.310263 | 80 | 0.648372 |
import functools
from collections import defaultdict
from typing import Dict, Iterable, NamedTuple, Sequence, Tuple
from .extent import Extent
from .inode import Chunk, ChunkClone, Clone
from .inode_id import InodeID
class _CloneExtentRef(NamedTuple):
clone: Clone
extent: Extent
offset: int
... | true | true |
790acba3f445cec85703cf63215660fb9cb174a4 | 1,797 | py | Python | examples/customisations/plot_rainbow_serif_bins.py | Jiaming1999/ChainConsumer | 5606696525d91f11d8093085934fa352b98ce97c | [
"MIT"
] | 55 | 2016-08-31T01:02:41.000Z | 2022-03-15T15:23:29.000Z | examples/customisations/plot_rainbow_serif_bins.py | Jiaming1999/ChainConsumer | 5606696525d91f11d8093085934fa352b98ce97c | [
"MIT"
] | 86 | 2016-10-09T23:20:00.000Z | 2022-03-23T09:55:57.000Z | examples/customisations/plot_rainbow_serif_bins.py | Jiaming1999/ChainConsumer | 5606696525d91f11d8093085934fa352b98ce97c | [
"MIT"
] | 17 | 2016-08-31T08:35:37.000Z | 2021-07-24T16:39:26.000Z | # -*- coding: utf-8 -*-
"""
=======================
Cmap and Custom Bins
=======================
Invoke the cmap colour scheme and choose how many bins to use with your data.
By default, the cmap colour scheme is used if you have many, many chains. You can
enable it before that point if you wish and pass in the cmap ... | 39.933333 | 94 | 0.70729 |
import numpy as np
from numpy.random import normal, random, multivariate_normal
from chainconsumer import ChainConsumer
np.random.seed(0)
cov = 0.3 * random(size=(3, 3)) + np.identity(3)
data = multivariate_normal(normal(size=3), np.dot(cov, cov.T), size=100000)
cov = 0.3 * random(size=(3, 3)) + np.identity(3)
data2... | true | true |
790acc9953ae5e0ad3fb887e45f2807efc3c43e8 | 1,298 | py | Python | UML2ER/contracts/unit/HContractUnitR03_ConnectedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | UML2ER/contracts/unit/HContractUnitR03_ConnectedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | UML2ER/contracts/unit/HContractUnitR03_ConnectedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HContractUnitR03_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HContractUnitR03_ConnectedLHS
"""
# Flag this instance as compiled now
self.is_compil... | 26.489796 | 114 | 0.716487 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HContractUnitR03_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
self.is_compiled = True
super(HContractUnitR03_ConnectedLHS, self).__init__(name='HContractUnitR03_ConnectedLHS', num_nodes=0, edges=[])
sel... | true | true |
790ace19384d70584442abecc4540ceb6f9392b5 | 1,585 | py | Python | tiveU/users/views.py | rds0751/newtiveu | 779ac840f0787ea0e74701b43d4320b44429527e | [
"MIT"
] | null | null | null | tiveU/users/views.py | rds0751/newtiveu | 779ac840f0787ea0e74701b43d4320b44429527e | [
"MIT"
] | null | null | null | tiveU/users/views.py | rds0751/newtiveu | 779ac840f0787ea0e74701b43d4320b44429527e | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from tiveU.articles.models import Article
from .models import User
class UserDetailView(LoginRequiredMixin, DetailView):
model = User
# The... | 33.723404 | 80 | 0.705363 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from tiveU.articles.models import Article
from .models import User
class UserDetailView(LoginRequiredMixin, DetailView):
model = User
... | true | true |
790ad287fb92682456101e4a4670286bc0608205 | 3,498 | py | Python | BlogProject/settings.py | lwpdzq/BlogProject | bd46434722948ddb26e1dc9bd9c652e9531cf32b | [
"MIT"
] | null | null | null | BlogProject/settings.py | lwpdzq/BlogProject | bd46434722948ddb26e1dc9bd9c652e9531cf32b | [
"MIT"
] | null | null | null | BlogProject/settings.py | lwpdzq/BlogProject | bd46434722948ddb26e1dc9bd9c652e9531cf32b | [
"MIT"
] | null | null | null | """
Django settings for BlogProject project.
Generated by 'django-admin startproject' using Django 1.11.20.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impo... | 25.911111 | 91 | 0.69697 |
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,os.path.join(BASE_DIR, 'apps'))
SECRET_KEY = 'l-r2=6&(#p$f1qn$xzk6vce99ojk1nit&x7l_hqi9%&u$f#am&'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.... | true | true |
790ad2c7c75ae801e7758e65bed03fd84cb2f24e | 685 | py | Python | analyzer/migrations/0005_auto_20200329_1308.py | 4elovek37/diseases_risk_analysing | 3664eaed09f749851fced467bd43e911d5e04ee3 | [
"MIT"
] | null | null | null | analyzer/migrations/0005_auto_20200329_1308.py | 4elovek37/diseases_risk_analysing | 3664eaed09f749851fced467bd43e911d5e04ee3 | [
"MIT"
] | 4 | 2021-03-19T02:16:42.000Z | 2021-09-22T18:55:20.000Z | analyzer/migrations/0005_auto_20200329_1308.py | bogdanvso/diseases_risk_analysing | 3664eaed09f749851fced467bd43e911d5e04ee3 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-29 13:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('analyzer', '0004_auto_20200328_1750'),
]
operations = [
migrations.AddField(
model_name='diseas... | 27.4 | 115 | 0.626277 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('analyzer', '0004_auto_20200328_1750'),
]
operations = [
migrations.AddField(
model_name='diseasestats',
name='country',
... | true | true |
790ad3c47a8bf507fb7765cce0060763b00a775b | 7,818 | py | Python | grammar_induction/earley_parser/nltk/tag/stanford.py | tdonca/OpenBottle | f03d80e7b3645232fb97f91cf7fc2dc02f101ac2 | [
"MIT"
] | 6 | 2017-01-22T03:15:01.000Z | 2019-12-01T16:19:36.000Z | grammar_induction/earley_parser/nltk/tag/stanford.py | tdonca/OpenBottle | f03d80e7b3645232fb97f91cf7fc2dc02f101ac2 | [
"MIT"
] | 3 | 2020-03-24T15:38:23.000Z | 2021-02-02T21:44:18.000Z | grammar_induction/earley_parser/nltk/tag/stanford.py | tdonca/OpenBottle | f03d80e7b3645232fb97f91cf7fc2dc02f101ac2 | [
"MIT"
] | 6 | 2017-01-19T21:49:55.000Z | 2021-04-14T09:57:17.000Z | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the Stanford Part-of-speech and Named-Entity Taggers
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Nitin Madnani <nmadnani@ets.org>
# Rami Al-Rfou' <ralrfou@cs.stonybrook.edu>
# URL: <http://nltk.org/>
# For license information, see LICENSE.T... | 39.685279 | 183 | 0.637375 |
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import os
import tempfile
from subprocess import PIPE
import warnings
from nltk.internals import find_file, find_jar, config_java, java, _java_options, find_jars_within_path
from nltk.tag.api import TaggerI
from nltk import compat
_stanford_... | true | true |
790ad3db4c845d8c00ddade9f2c78fee16710c04 | 8,406 | py | Python | docs/source/conf.py | shawnr/submittable-api-client | ff0ac5f4bfcfbaa332b8611e5404b088609c3a47 | [
"MIT"
] | 2 | 2016-06-06T21:19:29.000Z | 2019-05-19T00:19:43.000Z | docs/source/conf.py | shawnr/submittable-api-client | ff0ac5f4bfcfbaa332b8611e5404b088609c3a47 | [
"MIT"
] | 1 | 2019-03-19T21:03:06.000Z | 2019-03-20T13:17:54.000Z | docs/source/conf.py | shawnr/submittable-api-client | ff0ac5f4bfcfbaa332b8611e5404b088609c3a47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Submittable API Client documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 9 15:21:21 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | 31.961977 | 112 | 0.721865 |
import sys
import os
dirname = os.path.dirname
sys.path.insert(0, os.path.join(dirname(dirname(dirname(os.path.abspath(__file__)))), 'submittable_api_client'))
print sys.path
extensions = [
'sphinx.ext.autodoc',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc ... | false | true |
790ad4582008ab1ba07b35f56d8a3633c3c83fc4 | 9,708 | py | Python | tests/test_clustering.py | hakimakbarmaulana/dtaidistance | ddf4a8111732d4429686d96c9195a81151be1dd8 | [
"Apache-2.0"
] | 711 | 2017-02-07T07:24:58.000Z | 2022-03-31T07:46:47.000Z | tests/test_clustering.py | hakimakbarmaulana/dtaidistance | ddf4a8111732d4429686d96c9195a81151be1dd8 | [
"Apache-2.0"
] | 142 | 2018-04-09T10:36:11.000Z | 2022-03-31T11:30:26.000Z | tests/test_clustering.py | hakimakbarmaulana/dtaidistance | ddf4a8111732d4429686d96c9195a81151be1dd8 | [
"Apache-2.0"
] | 155 | 2017-06-01T08:37:45.000Z | 2022-03-23T08:50:13.000Z | import os
import sys
import tempfile
import pytest
import logging
from pathlib import Path
from dtaidistance import dtw, dtw_ndim, clustering, util_numpy
import dtaidistance.dtw_visualisation as dtwvis
from dtaidistance.exceptions import PyClusteringException
logger = logging.getLogger("be.kuleuven.dtai.distance")
d... | 37.053435 | 108 | 0.525546 | import os
import sys
import tempfile
import pytest
import logging
from pathlib import Path
from dtaidistance import dtw, dtw_ndim, clustering, util_numpy
import dtaidistance.dtw_visualisation as dtwvis
from dtaidistance.exceptions import PyClusteringException
logger = logging.getLogger("be.kuleuven.dtai.distance")
d... | true | true |
790ad4e241a7003192a040b85576df147daa3b37 | 2,025 | py | Python | portfolio/Python/scrapy/seapets/thepetexpress.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/seapets/thepetexpress.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/seapets/thepetexpress.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import hashlib
import csv
from product_spiders.item... | 35.526316 | 89 | 0.668148 | import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import hashlib
import csv
from product_spiders.item... | true | true |
790ad5094a9424e40f43d661a64daa14ff9734db | 490 | py | Python | modulo 3/aulas/4.0 - Funcoes.py | GabrielBrotas/Python | 9441b6b86ff3cb7fa5921b508c484075adac08b3 | [
"MIT"
] | null | null | null | modulo 3/aulas/4.0 - Funcoes.py | GabrielBrotas/Python | 9441b6b86ff3cb7fa5921b508c484075adac08b3 | [
"MIT"
] | null | null | null | modulo 3/aulas/4.0 - Funcoes.py | GabrielBrotas/Python | 9441b6b86ff3cb7fa5921b508c484075adac08b3 | [
"MIT"
] | null | null | null | # Funcoes servem para quando tivermos coisas repetitivas poder simplificar o programa
def lin(): # para definir um afuncao ela tem que ter parenteses no finalk
print('=-'*30)
lin()
print('Bem Vindo')
lin()
nome = str(input('Qual seu nome? '))
lin()
print(f'Tenha um otimo dia {nome}!')
lin()
def mensagem(msg):... | 20.416667 | 98 | 0.677551 |
def lin():
print('=-'*30)
lin()
print('Bem Vindo')
lin()
nome = str(input('Qual seu nome? '))
lin()
print(f'Tenha um otimo dia {nome}!')
lin()
def mensagem(msg):
print('-'*30)
print(msg)
print('-'*30)
mensagem('SISTEMA DE ALUNOS')
| true | true |
790ad5e42ec47c633f039098b436e19e0c16f40a | 956 | py | Python | census_data_downloader/core/decorators.py | JoeGermuska/census-data-downloader | 0098b9e522b78ad0e30301c9845ecbcc903c62e4 | [
"MIT"
] | 170 | 2019-04-01T01:41:42.000Z | 2022-03-25T21:22:06.000Z | census_data_downloader/core/decorators.py | JoeGermuska/census-data-downloader | 0098b9e522b78ad0e30301c9845ecbcc903c62e4 | [
"MIT"
] | 68 | 2019-03-31T22:52:43.000Z | 2021-08-30T16:33:54.000Z | census_data_downloader/core/decorators.py | JoeGermuska/census-data-downloader | 0098b9e522b78ad0e30301c9845ecbcc903c62e4 | [
"MIT"
] | 34 | 2019-04-02T17:57:16.000Z | 2022-03-28T17:22:35.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*
"""
Decorators to help manage our custom classes.
"""
TABLE_LIST = []
def register(cls):
"""
A decorator to register new table configuration classes.
"""
TABLE_LIST.append(cls)
return cls
def downloader(func):
"""
A decorator to download data... | 27.314286 | 83 | 0.634937 |
TABLE_LIST = []
def register(cls):
TABLE_LIST.append(cls)
return cls
def downloader(func):
def inner(*args, **kwargs):
table_config = args[0]
downloader_klass = func(table_config)
for year in table_config.years_to_download:
do... | true | true |
790ad5e933260f2e5e4e6abcd110a9e775d9b371 | 10,790 | py | Python | scripts/irods/database_upgrade.py | tempoz/irods | a64c5e9cfb86af725f8f20ae940591adef8e02f0 | [
"BSD-3-Clause"
] | null | null | null | scripts/irods/database_upgrade.py | tempoz/irods | a64c5e9cfb86af725f8f20ae940591adef8e02f0 | [
"BSD-3-Clause"
] | null | null | null | scripts/irods/database_upgrade.py | tempoz/irods | a64c5e9cfb86af725f8f20ae940591adef8e02f0 | [
"BSD-3-Clause"
] | null | null | null | from . import database_connect
from .exceptions import IrodsError, IrodsWarning
import logging
import re
def run_update(irods_config, cursor):
l = logging.getLogger(__name__)
new_schema_version = database_connect.get_schema_version_in_database(cursor) + 1
l.info('Updating to schema version %d...', new_sch... | 149.861111 | 1,001 | 0.779333 | from . import database_connect
from .exceptions import IrodsError, IrodsWarning
import logging
import re
def run_update(irods_config, cursor):
l = logging.getLogger(__name__)
new_schema_version = database_connect.get_schema_version_in_database(cursor) + 1
l.info('Updating to schema version %d...', new_sch... | true | true |
790ad6bc5dfa928e760095a113c8e989519e42ee | 9,163 | py | Python | laserfiche_api/models/watermark.py | Layer8Err/laserfiche_api | 8c9030c8f5cc245b61858bd096a1ad3c58cdbfd2 | [
"BSD-2-Clause"
] | 1 | 2021-06-17T23:51:25.000Z | 2021-06-17T23:51:25.000Z | laserfiche_api/models/watermark.py | Layer8Err/laserfiche_api | 8c9030c8f5cc245b61858bd096a1ad3c58cdbfd2 | [
"BSD-2-Clause"
] | null | null | null | laserfiche_api/models/watermark.py | Layer8Err/laserfiche_api | 8c9030c8f5cc245b61858bd096a1ad3c58cdbfd2 | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
"""
Laserfiche API
Welcome to the Laserfiche API Swagger Playground. You can try out any of our API calls against your live Laserfiche Cloud account. Visit the developer center for more details: <a href=\"https://developer.laserfiche.com\">https://developer.laserfiche.com</a><p><strong>Build# ... | 36.217391 | 314 | 0.653716 |
import pprint
import re
import six
class Watermark(object):
swagger_types = {
'watermark_text': 'str',
'watermark_text_size': 'int',
'watermark_position': 'OneOfWatermarkWatermarkPosition',
'watermark_rotation_angle': 'int',
'is_watermark_mandatory': 'bool',
'w... | true | true |
790ad83ca9fa2bfbd11a4af5e5a105ba53305769 | 375 | py | Python | tests/test_base.py | khulaifi95/cool-search | b18b54994fa792de92a6d27a24c0f600af73c93f | [
"Unlicense"
] | null | null | null | tests/test_base.py | khulaifi95/cool-search | b18b54994fa792de92a6d27a24c0f600af73c93f | [
"Unlicense"
] | null | null | null | tests/test_base.py | khulaifi95/cool-search | b18b54994fa792de92a6d27a24c0f600af73c93f | [
"Unlicense"
] | null | null | null | import pytest
from cool_search import BaseClass, base_function
given = pytest.mark.parametrize
@given("fn", [BaseClass(), base_function])
def test_parameterized(fn):
assert "hello from" in fn()
def test_base_function():
assert base_function() == "hello from base function"
def test_base_class():
asse... | 19.736842 | 62 | 0.733333 | import pytest
from cool_search import BaseClass, base_function
given = pytest.mark.parametrize
@given("fn", [BaseClass(), base_function])
def test_parameterized(fn):
assert "hello from" in fn()
def test_base_function():
assert base_function() == "hello from base function"
def test_base_class():
asse... | true | true |
790ad8b8e290b7e193979ee04d3a148e6f33e9c9 | 12,058 | py | Python | homeassistant/components/media_player/soundtouch.py | maihde/home-assistant | 688d70644949a658e0607e52b3896a2c4c8a85e7 | [
"Apache-2.0"
] | 2 | 2018-01-15T06:36:11.000Z | 2019-06-06T14:08:01.000Z | homeassistant/components/media_player/soundtouch.py | maihde/home-assistant | 688d70644949a658e0607e52b3896a2c4c8a85e7 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/media_player/soundtouch.py | maihde/home-assistant | 688d70644949a658e0607e52b3896a2c4c8a85e7 | [
"Apache-2.0"
] | 3 | 2018-08-27T10:08:30.000Z | 2020-07-04T10:07:03.000Z | """
Support for interface with a Bose Soundtouch.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.soundtouch/
"""
import logging
import re
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.comp... | 33.035616 | 79 | 0.625643 | import logging
import re
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.media_player import (
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_STEP,
SUPPORT_VOLUME_SET, SUPPORT_TURN... | true | true |
790ad8fbe755827fb30faf59159513c915ce20bf | 160 | py | Python | bitcoin_tweeter/credentials.py | llamafarmer/bitcoin_tweeter | 5ebc07e01ee3d5465ad9115438e9de6ee64b6011 | [
"MIT"
] | 5 | 2017-10-25T12:07:42.000Z | 2019-03-02T03:56:13.000Z | code/25-27-error-handling/credentials.py | llamafarmer/100_days_of_code | 6af973157aa4c77cd6f88bf1f0fa5e60a375339c | [
"MIT"
] | null | null | null | code/25-27-error-handling/credentials.py | llamafarmer/100_days_of_code | 6af973157aa4c77cd6f88bf1f0fa5e60a375339c | [
"MIT"
] | 3 | 2017-10-25T04:40:57.000Z | 2018-04-25T07:00:44.000Z | consumer_key = 'YOUR CONSUMER KEY'
consumer_secret = 'YOUR CONSUMER SECRET'
access_token = 'YOUR ACCESS TOKEN'
access_token_secret = 'YOUR ACCESS TOKEN SECRET'
| 32 | 48 | 0.79375 | consumer_key = 'YOUR CONSUMER KEY'
consumer_secret = 'YOUR CONSUMER SECRET'
access_token = 'YOUR ACCESS TOKEN'
access_token_secret = 'YOUR ACCESS TOKEN SECRET'
| true | true |
790ad94490493a8a472f94a2bac069b00402d6b8 | 2,620 | py | Python | setup.py | morpframework/morpfw | b867e5809d6c52e8839586670a29fcd179ce64c7 | [
"Apache-2.0"
] | 8 | 2018-12-08T01:41:58.000Z | 2020-12-21T15:30:12.000Z | setup.py | morpframework/morpfw | b867e5809d6c52e8839586670a29fcd179ce64c7 | [
"Apache-2.0"
] | 17 | 2019-02-05T15:01:32.000Z | 2020-04-28T16:17:42.000Z | setup.py | morpframework/morpfw | b867e5809d6c52e8839586670a29fcd179ce64c7 | [
"Apache-2.0"
] | 2 | 2018-12-08T05:03:37.000Z | 2019-03-20T07:15:21.000Z | import os
import sys
from setuptools import find_packages, setup
IS_RTD = os.environ.get("READTHEDOCS", None)
version = "0.4.0b14.dev0"
long_description = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
install_requires = [
"morepath==0.19",
"alembic",
"rulez>=0.1.4,<0.2.0",
"inv... | 22.782609 | 94 | 0.579771 | import os
import sys
from setuptools import find_packages, setup
IS_RTD = os.environ.get("READTHEDOCS", None)
version = "0.4.0b14.dev0"
long_description = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
install_requires = [
"morepath==0.19",
"alembic",
"rulez>=0.1.4,<0.2.0",
"inv... | true | true |
790ad996aeb7de9287fe537e06e6057d5c60f7cb | 1,491 | py | Python | tests/test_ds.py | kororo/rand | af0496a33e4eb4c08d1e19cf718d58393585c6cb | [
"MIT"
] | null | null | null | tests/test_ds.py | kororo/rand | af0496a33e4eb4c08d1e19cf718d58393585c6cb | [
"MIT"
] | null | null | null | tests/test_ds.py | kororo/rand | af0496a33e4eb4c08d1e19cf718d58393585c6cb | [
"MIT"
] | null | null | null | from tests import create_rand
def prepare_database_with_table(name: str, rows: list):
from peewee import IntegerField, Proxy, CharField, Model
from playhouse.sqlite_ext import CSqliteExtDatabase
db = Proxy()
db.initialize(CSqliteExtDatabase(':memory:', bloomfilter=True))
NameModel = type(name, (M... | 33.133333 | 78 | 0.652582 | from tests import create_rand
def prepare_database_with_table(name: str, rows: list):
from peewee import IntegerField, Proxy, CharField, Model
from playhouse.sqlite_ext import CSqliteExtDatabase
db = Proxy()
db.initialize(CSqliteExtDatabase(':memory:', bloomfilter=True))
NameModel = type(name, (M... | true | true |
790ad9c9a59e8e1075423ee5117501b1890483f8 | 177 | py | Python | odoo/openerp/addons/test_new_api/tests/__init__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | 1 | 2019-12-29T11:53:56.000Z | 2019-12-29T11:53:56.000Z | odoo/openerp/addons/test_new_api/tests/__init__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | odoo/openerp/addons/test_new_api/tests/__init__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from . import test_related
from . import test_new_fields
from . import test_onchange
from . import test_field_conversions
from . import test_attributes
| 22.125 | 36 | 0.774011 |
from . import test_related
from . import test_new_fields
from . import test_onchange
from . import test_field_conversions
from . import test_attributes
| true | true |
790adbe9ccc1aac072309ed10ac00cdd52d18e47 | 324 | py | Python | recipe/run_test.py | csdms-stack/permamodel-frostnumbergeo-csdms-recipe | 007922309c891ec8b11ef050986887e9747593e5 | [
"MIT"
] | null | null | null | recipe/run_test.py | csdms-stack/permamodel-frostnumbergeo-csdms-recipe | 007922309c891ec8b11ef050986887e9747593e5 | [
"MIT"
] | null | null | null | recipe/run_test.py | csdms-stack/permamodel-frostnumbergeo-csdms-recipe | 007922309c891ec8b11ef050986887e9747593e5 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import os
os.mkdir('_testing')
os.chdir('_testing')
os.environ['MPLBACKEND'] = 'Agg'
from pymt.components import FrostNumberGeoModel as Model
model = Model()
for default in model.defaults:
print('{name}: {val} {units}'.format(
name=default[0], val=default[1][0], units=default[1][1... | 21.6 | 65 | 0.682099 |
import os
os.mkdir('_testing')
os.chdir('_testing')
os.environ['MPLBACKEND'] = 'Agg'
from pymt.components import FrostNumberGeoModel as Model
model = Model()
for default in model.defaults:
print('{name}: {val} {units}'.format(
name=default[0], val=default[1][0], units=default[1][1]))
| true | true |
790adc33e460e957ad88c928f4148caf97fe21f2 | 1,969 | py | Python | TextRecognitionDataGenerator/idcard_file_parse.py | yuliangzhang/TextRecognitionDataGenerator | 38c6a2906b17580d0618ebf92e016a5331c965e7 | [
"MIT"
] | null | null | null | TextRecognitionDataGenerator/idcard_file_parse.py | yuliangzhang/TextRecognitionDataGenerator | 38c6a2906b17580d0618ebf92e016a5331c965e7 | [
"MIT"
] | null | null | null | TextRecognitionDataGenerator/idcard_file_parse.py | yuliangzhang/TextRecognitionDataGenerator | 38c6a2906b17580d0618ebf92e016a5331c965e7 | [
"MIT"
] | null | null | null | # import pandas as pd
#
# csv_data = pd.read_csv('E:\\AI_Object_Detect\\Code\\TextRecognitionDataGenerator\\idcard_file.txt', sep=',', header=0, encoding='UTF-8')
# N = 5
# csv_batch_data = csv_data.tail(N)
# print(csv_batch_data.shape)
import csv
import os
idcard_file = 'E:\\AI_Object_Detect\\Code\\TextRecognitionDat... | 33.372881 | 160 | 0.630269 |
import csv
import os
idcard_file = 'E:\\AI_Object_Detect\\Code\\TextRecognitionDataGenerator\\idcard_file.txt'
idcard_data = []
with open(idcard_file, 'r', encoding='UTF-8') as csvfile:
csv_reader = csv.reader(csvfile)
birth_header = next(csv_reader)
for row in csv_reader:
tmp_str = row... | true | true |
790adcf0f09bd61554b66a4fd55c7518a3d277e9 | 4,742 | py | Python | recipes/cmake/3.x.x/conanfile.py | nicraMarcin/conan-center-index | c31521c29eaf309f91d2efffb7f27c7795302420 | [
"MIT"
] | null | null | null | recipes/cmake/3.x.x/conanfile.py | nicraMarcin/conan-center-index | c31521c29eaf309f91d2efffb7f27c7795302420 | [
"MIT"
] | 2 | 2021-07-12T11:40:14.000Z | 2022-03-04T13:15:54.000Z | recipes/cmake/3.x.x/conanfile.py | ericLemanissier/conan-center-index | 24743f30fe24da91c4eabeb42e7457821029a9b9 | [
"MIT"
] | null | null | null | import os
from conans import tools, ConanFile, CMake
from conans.errors import ConanInvalidConfiguration, ConanException
class CMakeConan(ConanFile):
name = "cmake"
description = "Conan installer for CMake"
topics = ("conan", "cmake", "build", "installer")
url = "https://github.com/conan-io/conan-cent... | 39.848739 | 127 | 0.615141 | import os
from conans import tools, ConanFile, CMake
from conans.errors import ConanInvalidConfiguration, ConanException
class CMakeConan(ConanFile):
name = "cmake"
description = "Conan installer for CMake"
topics = ("conan", "cmake", "build", "installer")
url = "https://github.com/conan-io/conan-cent... | true | true |
790add3f01747408ad5054c9f590ac9059ccc3b0 | 961 | py | Python | pygame/lib/macosx.py | CiubucAlexandra/Theremine-Projet-Micriprocesseurs | 7670d9cb468b060135dc5f057b734db970da0f0c | [
"BSD-3-Clause"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | pygame/lib/macosx.py | CiubucAlexandra/Theremine-Projet-Micriprocesseurs | 7670d9cb468b060135dc5f057b734db970da0f0c | [
"BSD-3-Clause"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | pygame/lib/macosx.py | CiubucAlexandra/Theremine-Projet-Micriprocesseurs | 7670d9cb468b060135dc5f057b734db970da0f0c | [
"BSD-3-Clause"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | import os, sys
try:
import MacOS
except:
MacOS = None
from pygame.pkgdata import getResource
from pygame import sdlmain_osx
__all__ = ['Video_AutoInit']
def Video_AutoInit():
"""This is a function that's called from the c extension code
just before the display module is initialized"""
if Mac... | 30.03125 | 115 | 0.676379 | import os, sys
try:
import MacOS
except:
MacOS = None
from pygame.pkgdata import getResource
from pygame import sdlmain_osx
__all__ = ['Video_AutoInit']
def Video_AutoInit():
if MacOS and not MacOS.WMAvailable():
if not sdlmain_osx.WMEnable():
raise ImportError("Can not access the w... | true | true |
790add88bbf516becc94d87ef611e5073c481ff7 | 1,331 | py | Python | colour/examples/appearance/examples_llab.py | soma2000-lang/colour | bb7ee23ac65e09613af78bd18dd98dffb1a2904a | [
"BSD-3-Clause"
] | 1 | 2022-02-12T06:28:15.000Z | 2022-02-12T06:28:15.000Z | colour/examples/appearance/examples_llab.py | soma2000-lang/colour | bb7ee23ac65e09613af78bd18dd98dffb1a2904a | [
"BSD-3-Clause"
] | null | null | null | colour/examples/appearance/examples_llab.py | soma2000-lang/colour | bb7ee23ac65e09613af78bd18dd98dffb1a2904a | [
"BSD-3-Clause"
] | null | null | null | """
Showcases *LLAB(l:c)* colour appearance model computations.
"""
import numpy as np
import colour
from colour.appearance.llab import CAM_ReferenceSpecification_LLAB
from colour.utilities import message_box
message_box('"LLAB(l:c)" Colour Appearance Model Computations')
XYZ = np.array([19.01, 20.00, 21.78])
XYZ_0... | 30.953488 | 76 | 0.728024 |
import numpy as np
import colour
from colour.appearance.llab import CAM_ReferenceSpecification_LLAB
from colour.utilities import message_box
message_box('"LLAB(l:c)" Colour Appearance Model Computations')
XYZ = np.array([19.01, 20.00, 21.78])
XYZ_0 = np.array([95.05, 100.00, 108.88])
Y_b = 20.0
L = 318.31
surround ... | true | true |
790adf0135986079574bda3f854a77d0b09c75f3 | 286 | py | Python | racerCalculator.py | Sam-Gram/PiWood-Derby | e2d18f595100e73923a55f8d7cb396ecb87fc727 | [
"MIT"
] | 1 | 2017-12-06T19:35:20.000Z | 2017-12-06T19:35:20.000Z | racerCalculator.py | Sam-Gram/PiWood-Derby | e2d18f595100e73923a55f8d7cb396ecb87fc727 | [
"MIT"
] | null | null | null | racerCalculator.py | Sam-Gram/PiWood-Derby | e2d18f595100e73923a55f8d7cb396ecb87fc727 | [
"MIT"
] | null | null | null | # This utility function comes up with which racers to use in the next race
def racerCalculator(raceNum, numCars):
print("RaceNum",raceNum)
print("numCars",numCars)
if raceNum is None:
raceNum = 1
f = lambda x : (raceNum*3+x) % numCars
return f(0),f(1),f(2)
| 28.6 | 74 | 0.657343 |
def racerCalculator(raceNum, numCars):
print("RaceNum",raceNum)
print("numCars",numCars)
if raceNum is None:
raceNum = 1
f = lambda x : (raceNum*3+x) % numCars
return f(0),f(1),f(2)
| true | true |
790ae00d40eb0d792deaa0b0143442f1beb1f66b | 12,429 | py | Python | dcs_rest_client.py | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | f02a1b34abdeeb3927438eb57580e7bc27283b3b | [
"Apache-2.0"
] | null | null | null | dcs_rest_client.py | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | f02a1b34abdeeb3927438eb57580e7bc27283b3b | [
"Apache-2.0"
] | null | null | null | dcs_rest_client.py | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | f02a1b34abdeeb3927438eb57580e7bc27283b3b | [
"Apache-2.0"
] | null | null | null | import requests
import argparse
import logging
import coloredlogs
import threading
from flask import Flask, request, jsonify
from flask_swagger import swagger
from waitress import serve
import subprocess
import json
from kafka import KafkaConsumer
from threading import Thread
from threading import Timer
from datetime i... | 42.132203 | 154 | 0.629898 | import requests
import argparse
import logging
import coloredlogs
import threading
from flask import Flask, request, jsonify
from flask_swagger import swagger
from waitress import serve
import subprocess
import json
from kafka import KafkaConsumer
from threading import Thread
from threading import Timer
from datetime i... | true | true |
790ae0aeb23331f047ea7f73a20796f80cd8cb55 | 840 | py | Python | logdna/utils.py | nimbinatus/python | 1941935597e2250579d2876b2234c648fd236f1b | [
"MIT"
] | null | null | null | logdna/utils.py | nimbinatus/python | 1941935597e2250579d2876b2234c648fd236f1b | [
"MIT"
] | null | null | null | logdna/utils.py | nimbinatus/python | 1941935597e2250579d2876b2234c648fd236f1b | [
"MIT"
] | null | null | null | import json
import socket
def is_jsonable(obj):
try:
json.dumps(obj)
return True
except (TypeError, OverflowError, ValueError):
return False
def sanitize_meta(meta):
keys_to_sanitize = []
for key, value in meta.items():
if not is_jsonable(value):
keys_to_s... | 22.702703 | 74 | 0.591667 | import json
import socket
def is_jsonable(obj):
try:
json.dumps(obj)
return True
except (TypeError, OverflowError, ValueError):
return False
def sanitize_meta(meta):
keys_to_sanitize = []
for key, value in meta.items():
if not is_jsonable(value):
keys_to_s... | true | true |
790ae12bafd7a1452c9a94286da7c5c51a49a888 | 4,648 | py | Python | appgate/openapi/attribmaker.py | appgate/sdp-operator | 289927e07eca84003aa4bd4631b57dc9955eee23 | [
"MIT"
] | 6 | 2020-09-22T13:21:05.000Z | 2022-01-06T01:49:22.000Z | appgate/openapi/attribmaker.py | appgate/sdp-operator | 289927e07eca84003aa4bd4631b57dc9955eee23 | [
"MIT"
] | 36 | 2020-09-23T06:38:51.000Z | 2022-02-09T13:53:32.000Z | appgate/openapi/attribmaker.py | appgate/sdp-operator | 289927e07eca84003aa4bd4631b57dc9955eee23 | [
"MIT"
] | 3 | 2021-07-27T18:16:52.000Z | 2022-03-01T22:18:15.000Z | from uuid import uuid4
from typing import Optional, Dict, Any, List
from appgate.openapi.types import OpenApiDict, AttribType, AttributesDict, \
IGNORED_EQ_ATTRIBUTES, OpenApiParserException, InstanceMakerConfig, UUID_REFERENCE_FIELD, K8S_LOADERS_FIELD_NAME
write_only_formats = {'PEM', 'password'}
class SimpleA... | 36.598425 | 116 | 0.596386 | from uuid import uuid4
from typing import Optional, Dict, Any, List
from appgate.openapi.types import OpenApiDict, AttribType, AttributesDict, \
IGNORED_EQ_ATTRIBUTES, OpenApiParserException, InstanceMakerConfig, UUID_REFERENCE_FIELD, K8S_LOADERS_FIELD_NAME
write_only_formats = {'PEM', 'password'}
class SimpleA... | true | true |
790ae1cd5f1909b3ea05f4bc1e22db416ad39314 | 13,230 | py | Python | deepext_with_lightning/metrics/object_detection.py | pei223/deepext_with_lightning | e40ac19844a05864f803431d8ef4a534286a0950 | [
"MIT"
] | 1 | 2021-02-25T14:30:08.000Z | 2021-02-25T14:30:08.000Z | deepext_with_lightning/metrics/object_detection.py | pei223/deepext_with_lightning | e40ac19844a05864f803431d8ef4a534286a0950 | [
"MIT"
] | null | null | null | deepext_with_lightning/metrics/object_detection.py | pei223/deepext_with_lightning | e40ac19844a05864f803431d8ef4a534286a0950 | [
"MIT"
] | null | null | null | from typing import List, Tuple, Union
import numpy as np
import torch
import pytorch_lightning as pl
def calc_area(bbox: np.ndarray):
return (bbox[2] - bbox[0]) * (bbox[3] - bbox[1])
def calc_bbox_overlap_union_iou(pred: np.ndarray or None, teacher: np.ndarray) -> Tuple[float, float, float]:
"""
:para... | 47.589928 | 115 | 0.621391 | from typing import List, Tuple, Union
import numpy as np
import torch
import pytorch_lightning as pl
def calc_area(bbox: np.ndarray):
return (bbox[2] - bbox[0]) * (bbox[3] - bbox[1])
def calc_bbox_overlap_union_iou(pred: np.ndarray or None, teacher: np.ndarray) -> Tuple[float, float, float]:
teacher_area ... | true | true |
790ae308eb3a6aeeafb3c1213e67a5e87168931c | 1,200 | py | Python | examples/linear_regression/linear_regression_numba.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 140 | 2017-07-15T21:17:44.000Z | 2022-03-19T00:56:05.000Z | examples/linear_regression/linear_regression_numba.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 24 | 2017-07-24T16:25:35.000Z | 2021-12-08T17:54:38.000Z | examples/linear_regression/linear_regression_numba.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 50 | 2017-07-15T21:15:16.000Z | 2021-12-12T15:27:05.000Z | #
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-2-Clause
#
import numba
import numpy as np
import argparse
import time
@numba.njit()
def linear_regression(Y, X, w, iterations, alphaN):
for i in range(iterations):
w -= alphaN * np.dot(X.T, np.dot(X,w)-Y)
return w
def main():
... | 29.268293 | 80 | 0.661667 |
import numba
import numpy as np
import argparse
import time
@numba.njit()
def linear_regression(Y, X, w, iterations, alphaN):
for i in range(iterations):
w -= alphaN * np.dot(X.T, np.dot(X,w)-Y)
return w
def main():
parser = argparse.ArgumentParser(description='Linear Regression.')
parser... | true | true |
790ae362b32658dd0747cc1017b53d5aa98dd30a | 17,875 | py | Python | nlpia/book/examples/ch09.py | brusic/nlpia | e239074eaa1fd51eb1c9a35d53a69e3b15343f57 | [
"MIT"
] | 1 | 2021-04-15T04:26:00.000Z | 2021-04-15T04:26:00.000Z | nlpia/book/examples/ch09.py | brusic/nlpia | e239074eaa1fd51eb1c9a35d53a69e3b15343f57 | [
"MIT"
] | null | null | null | nlpia/book/examples/ch09.py | brusic/nlpia | e239074eaa1fd51eb1c9a35d53a69e3b15343f57 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[ ]:
import os
import re
import tarfile
import requests
from pugnlp.futil import path_status, find_files
# In[ ]:
# From the nlpia package for downloading data too big for the repo
BIG_URLS = {
'w2v': (
'https://www.dropbox.com/s/965dir4dje0hfi4/GoogleNews-vectors-negative300.... | 23.73838 | 215 | 0.669762 |
import os
import re
import tarfile
import requests
from pugnlp.futil import path_status, find_files
BIG_URLS = {
'w2v': (
'https://www.dropbox.com/s/965dir4dje0hfi4/GoogleNews-vectors-negative300.bin.gz?dl=1',
1647046227,
),
'slang': (
'https://www.dropbox.com/s/43c220... | true | true |
790ae4372b41981ec1d96d170bff059bcff2649f | 3,101 | py | Python | TFG/checkEpochAndUpdateJSON.py | lmagellanic-cloud/phishers-monitor | a60c9376aa539a843fa365be7fc87724c7da43a3 | [
"Apache-2.0"
] | null | null | null | TFG/checkEpochAndUpdateJSON.py | lmagellanic-cloud/phishers-monitor | a60c9376aa539a843fa365be7fc87724c7da43a3 | [
"Apache-2.0"
] | 12 | 2020-09-07T03:40:30.000Z | 2022-02-26T17:33:06.000Z | TFG/checkEpochAndUpdateJSON.py | lmagellanic-cloud/phishers-monitor | a60c9376aa539a843fa365be7fc87724c7da43a3 | [
"Apache-2.0"
] | null | null | null | import os
import json
import time
import datetime
import manageMonitoredUsersDB
pathToJSON = os.getcwd() + '/generatedJSON'
def get_local_json_timestamp_epoch(username, filename):
monitoredJSON = None
try:
monitoredJSON = json.load(open(pathToJSON + os.sep + filename, "r+"))
except:
with o... | 43.676056 | 135 | 0.659787 | import os
import json
import time
import datetime
import manageMonitoredUsersDB
pathToJSON = os.getcwd() + '/generatedJSON'
def get_local_json_timestamp_epoch(username, filename):
monitoredJSON = None
try:
monitoredJSON = json.load(open(pathToJSON + os.sep + filename, "r+"))
except:
with o... | true | true |
790ae4a1ee277fb088ab97674f3d90ed99520315 | 1,374 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class DataGridViewAutoSizeColumnMode(Enum,IComparable,IFormattable,IConvertible):
"""
Defines values for specifying how the width of a column is adjusted.
enum DataGridViewAutoSizeColumnMode,values: AllCells (6),AllCellsExceptHeader (4),ColumnHeader (2),DisplayedCells (10),DisplayedCellsExceptHeader (8),Fill... | 31.227273 | 215 | 0.703057 | class DataGridViewAutoSizeColumnMode(Enum,IComparable,IFormattable,IConvertible):
return DataGridViewAutoSizeColumnMode()
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
""" __format__(formattable: IFormattable,format: str) -> str """
pass
pass
... | true | true |
790ae50045a6dc57e1c2571136914d090f64c847 | 9,114 | py | Python | mentionbot/servermodules/truthgame.py | simshadows/Discord-mentionbot | fe3b6c3bdd2ff71f3a16666b3facce6ec97279c6 | [
"MIT"
] | null | null | null | mentionbot/servermodules/truthgame.py | simshadows/Discord-mentionbot | fe3b6c3bdd2ff71f3a16666b3facce6ec97279c6 | [
"MIT"
] | null | null | null | mentionbot/servermodules/truthgame.py | simshadows/Discord-mentionbot | fe3b6c3bdd2ff71f3a16666b3facce6ec97279c6 | [
"MIT"
] | null | null | null | import asyncio
import random
import re
import textwrap
import discord
from .. import utils, errors, cmd
from ..servermodule import ServerModule, registered
from ..enums import PrivilegeLevel
@registered
class TruthGame(ServerModule):
MODULE_NAME = "Truth Game"
MODULE_SHORT_DESCRIPTION = "Tools to play *Truth*... | 36.166667 | 113 | 0.650099 | import asyncio
import random
import re
import textwrap
import discord
from .. import utils, errors, cmd
from ..servermodule import ServerModule, registered
from ..enums import PrivilegeLevel
@registered
class TruthGame(ServerModule):
MODULE_NAME = "Truth Game"
MODULE_SHORT_DESCRIPTION = "Tools to play *Truth*... | true | true |
790ae62026b2c367eb828924be3b4fff54833bc9 | 310 | py | Python | main.py | maroemon58/twitter-bot | cf16eae5d08874b46c5215e1b43f9d15990ae995 | [
"MIT"
] | 2 | 2020-03-31T13:01:52.000Z | 2020-09-08T14:03:39.000Z | main.py | maroemon58/twitter-bot | cf16eae5d08874b46c5215e1b43f9d15990ae995 | [
"MIT"
] | null | null | null | main.py | maroemon58/twitter-bot | cf16eae5d08874b46c5215e1b43f9d15990ae995 | [
"MIT"
] | 1 | 2020-06-10T03:27:12.000Z | 2020-06-10T03:27:12.000Z | import config
from twitter import *
def main():
t = Twitter(
auth=OAuth(config.TW_TOKEN, config.TW_TOKEN_SECRET, config.TW_CONSUMER_KEY, config.TW_CONSUMER_SECRET))
# Post a message
msg = 'テスト投稿ですm(_ _)m'
t.statuses.update(status=msg)
if __name__ == '__main__':
main()
| 19.375 | 111 | 0.66129 | import config
from twitter import *
def main():
t = Twitter(
auth=OAuth(config.TW_TOKEN, config.TW_TOKEN_SECRET, config.TW_CONSUMER_KEY, config.TW_CONSUMER_SECRET))
msg = 'テスト投稿ですm(_ _)m'
t.statuses.update(status=msg)
if __name__ == '__main__':
main()
| true | true |
790ae6782d93d7c2fa0528fe37b2cb4019262d51 | 1,452 | py | Python | src/ClusterTrellis/utils.py | lbg251/ClusterTrellis | 06e9c8cd3f04f606e185b95f4d68703a34cc86ef | [
"MIT"
] | 6 | 2021-01-15T19:34:22.000Z | 2022-02-26T16:28:23.000Z | src/ClusterTrellis/utils.py | lbg251/ClusterTrellis | 06e9c8cd3f04f606e185b95f4d68703a34cc86ef | [
"MIT"
] | 2 | 2022-02-12T17:49:45.000Z | 2022-02-12T20:01:07.000Z | src/ClusterTrellis/utils.py | lbg251/ClusterTrellis | 06e9c8cd3f04f606e185b95f4d68703a34cc86ef | [
"MIT"
] | 2 | 2021-01-21T18:23:53.000Z | 2021-06-10T15:43:17.000Z | import os
import pickle
import string
import time
import logging
import numpy as np
def get_logger(name=__file__, level=logging.INFO):
logger = logging.getLogger(name)
if getattr(logger, "_init_done__", None):
logger.setLevel(level)
return logger
logger._init_done__ = True
logger.pr... | 22 | 75 | 0.63843 | import os
import pickle
import string
import time
import logging
import numpy as np
def get_logger(name=__file__, level=logging.INFO):
logger = logging.getLogger(name)
if getattr(logger, "_init_done__", None):
logger.setLevel(level)
return logger
logger._init_done__ = True
logger.pr... | true | true |
790ae70ce14134a9e8e35f625ba395c6200c440c | 1,102 | py | Python | ttv_api/channel.py | Atheridis/aptbot | ee4372b6f0878fe3678e6a67d44494cc92437856 | [
"MIT"
] | null | null | null | ttv_api/channel.py | Atheridis/aptbot | ee4372b6f0878fe3678e6a67d44494cc92437856 | [
"MIT"
] | null | null | null | ttv_api/channel.py | Atheridis/aptbot | ee4372b6f0878fe3678e6a67d44494cc92437856 | [
"MIT"
] | null | null | null | from ttv_api import *
@dataclass
class Channel:
broadcaster_id: str
broadcaster_login: str
broadcaster_name: str
game_name: str
game_id: str
broadcaster_language: str
title: str
delay: int
def get_channels(*channel_ids: str) -> Optional[list[Channel]]:
params = "?"
for channe... | 23.446809 | 63 | 0.554446 | from ttv_api import *
@dataclass
class Channel:
broadcaster_id: str
broadcaster_login: str
broadcaster_name: str
game_name: str
game_id: str
broadcaster_language: str
title: str
delay: int
def get_channels(*channel_ids: str) -> Optional[list[Channel]]:
params = "?"
for channe... | true | true |
790ae73bbd1969a7e7aab60abcc81d372d5c8c5f | 8,067 | py | Python | dicomanonymizer/batch_anonymizer.py | ademyanchuk/dicom-anonymizer | 6b9bff0564233819dee74dc12aad27cb6228c46e | [
"BSD-3-Clause"
] | 1 | 2021-08-03T11:37:29.000Z | 2021-08-03T11:37:29.000Z | dicomanonymizer/batch_anonymizer.py | ademyanchuk/dicom-anonymizer | 6b9bff0564233819dee74dc12aad27cb6228c46e | [
"BSD-3-Clause"
] | null | null | null | dicomanonymizer/batch_anonymizer.py | ademyanchuk/dicom-anonymizer | 6b9bff0564233819dee74dc12aad27cb6228c46e | [
"BSD-3-Clause"
] | null | null | null | """ This module is intended to extend functionality of the code provided by original authors.
The process is as follows:
1. User has to provide source root path containing (possibly nested) folders with dicom files
2. The program will recreate the structure in the destination root path and anonymize all
... | 31.026923 | 118 | 0.655882 |
import argparse
import json
import logging
import logging.config
import random
from pathlib import Path
from typing import Optional
import pydicom
from dicomanonymizer.anonym_state import AnonState
from dicomanonymizer.dicom_utils import fix_exposure
from dicomanonymizer.simpledicomanonymizer import (
anonymize_... | true | true |
790ae747593fe6ec9ef221e8ec100e0e758c352c | 2,599 | py | Python | examples/xgboost_simple.py | matsuken92/optuna | 79ce70c24c2150ffc8a4fd243e664976c6e1acef | [
"MIT"
] | 1 | 2019-09-28T10:31:01.000Z | 2019-09-28T10:31:01.000Z | examples/xgboost_simple.py | matsuken92/optuna | 79ce70c24c2150ffc8a4fd243e664976c6e1acef | [
"MIT"
] | null | null | null | examples/xgboost_simple.py | matsuken92/optuna | 79ce70c24c2150ffc8a4fd243e664976c6e1acef | [
"MIT"
] | null | null | null | """
Optuna example that optimizes a classifier configuration for cancer dataset
using XGBoost.
In this example, we optimize the validation accuracy of cancer detection
using XGBoost. We optimize both the choice of booster model and their hyper
parameters.
We have following two ways to execute this example:
(1) Execu... | 36.605634 | 99 | 0.69873 |
from __future__ import division
import numpy as np
import sklearn.datasets
import sklearn.metrics
from sklearn.model_selection import train_test_split
import xgboost as xgb
import optuna
target) = sklearn.datasets.load_breast_cancer(return_X_y=True)
train_x, test_x, train_y, test_y = train_test_split(data, t... | true | true |
790ae7c9f0357d9001dd157611c82be6f342fe97 | 1,213 | py | Python | mail_app/mail_processors/password_processor.py | teamsaucisse/Data-Mailing | 1815582008e27a3927a030deddc732a6a02add80 | [
"Apache-2.0"
] | null | null | null | mail_app/mail_processors/password_processor.py | teamsaucisse/Data-Mailing | 1815582008e27a3927a030deddc732a6a02add80 | [
"Apache-2.0"
] | null | null | null | mail_app/mail_processors/password_processor.py | teamsaucisse/Data-Mailing | 1815582008e27a3927a030deddc732a6a02add80 | [
"Apache-2.0"
] | null | null | null | import re
from mail_app.mail import Mail
from mail_app.mail_processors.abstract_processor import AbstractProcessor
from mail_app.processed_mail import ProcessedMail
class PasswordProcessor(AbstractProcessor):
general_keywords = ["password (reset|request|update|updated)", "(new|reset|change|updated|changed your) ... | 48.52 | 130 | 0.666117 | import re
from mail_app.mail import Mail
from mail_app.mail_processors.abstract_processor import AbstractProcessor
from mail_app.processed_mail import ProcessedMail
class PasswordProcessor(AbstractProcessor):
general_keywords = ["password (reset|request|update|updated)", "(new|reset|change|updated|changed your) ... | true | true |
790ae91cb20ee13046f79ff0d5426c5f04495bc1 | 1,643 | py | Python | comparison/pwgs/convert_inputs.py | J-Moravec/pairtree | 91cbba628b78aea31034efb080976fdb47d83976 | [
"MIT"
] | 15 | 2021-01-19T21:13:50.000Z | 2022-02-02T00:01:33.000Z | comparison/pwgs/convert_inputs.py | J-Moravec/pairtree | 91cbba628b78aea31034efb080976fdb47d83976 | [
"MIT"
] | 17 | 2020-11-25T09:41:03.000Z | 2022-03-28T04:52:14.000Z | comparison/pwgs/convert_inputs.py | J-Moravec/pairtree | 91cbba628b78aea31034efb080976fdb47d83976 | [
"MIT"
] | 6 | 2021-01-01T06:00:31.000Z | 2021-06-29T15:03:11.000Z | import sys
import os
import argparse
import json
import numpy as np
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'lib'))
import inputparser
import clustermaker
def write_ssms(variants, outfn):
_stringify = lambda A: ','.join([str(V) for V in A])
mu_r = 0.999
cols = ('id', 'gene', 'a', 'd'... | 28.824561 | 83 | 0.656726 | import sys
import os
import argparse
import json
import numpy as np
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'lib'))
import inputparser
import clustermaker
def write_ssms(variants, outfn):
_stringify = lambda A: ','.join([str(V) for V in A])
mu_r = 0.999
cols = ('id', 'gene', 'a', 'd'... | true | true |
790aea14d3c9f3472ebe4b7429ac86785b235ef6 | 3,492 | py | Python | http_prompt/context/__init__.py | elenalape/http-prompt | 09fd0cce1f3d58bd945ab96a948456cb151ac28c | [
"MIT"
] | 1 | 2020-10-29T14:17:46.000Z | 2020-10-29T14:17:46.000Z | http_prompt/context/__init__.py | elenalape/http-prompt | 09fd0cce1f3d58bd945ab96a948456cb151ac28c | [
"MIT"
] | null | null | null | http_prompt/context/__init__.py | elenalape/http-prompt | 09fd0cce1f3d58bd945ab96a948456cb151ac28c | [
"MIT"
] | null | null | null | from http_prompt.tree import Node
class Context(object):
def __init__(self, url=None, spec=None):
self.url = url
self.headers = {}
self.querystring_params = {}
self.body_params = {}
self.body_json_params = {}
self.options = {}
self.should_exit = False
... | 42.585366 | 98 | 0.505155 | from http_prompt.tree import Node
class Context(object):
def __init__(self, url=None, spec=None):
self.url = url
self.headers = {}
self.querystring_params = {}
self.body_params = {}
self.body_json_params = {}
self.options = {}
self.should_exit = False
... | true | true |
790aec2fc05aa1e6cedffaa7d116763b0bcfb9e2 | 2,395 | py | Python | streamlit_app.py | tbarford/bg_streamlit_demo | 72e54d2c9cff278edf1852ae04893fdb80d8ed4d | [
"Apache-2.0"
] | null | null | null | streamlit_app.py | tbarford/bg_streamlit_demo | 72e54d2c9cff278edf1852ae04893fdb80d8ed4d | [
"Apache-2.0"
] | null | null | null | streamlit_app.py | tbarford/bg_streamlit_demo | 72e54d2c9cff278edf1852ae04893fdb80d8ed4d | [
"Apache-2.0"
] | null | null | null | ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
##python3 script created by tBarford on 20220205
##
##
##File Description: This is the streamlit webapp MVP for BG Golf EI Profile Database Demo
## run in term w/ : streamlit run streamlit_app.py
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
import streamlit a... | 42.767857 | 152 | 0.612944 | ns = ['iron', 'wood'], key = 'type')
shaft = st.selectbox('Choose a shaft to display:', options = firestore.getShaftList(shaftType), key = 'shaft')
stiffness = st.selectbox('Choose a stiffness:', options = firestore.getStiffness(shaftType, shaft), key = 'stiff')
compare = st.radio('Compare an... | true | true |
790aecdd40d247bbd2cab185e89d5cd83d8f374d | 2,214 | py | Python | app/views/combiners_views.py | lawrence-gandhar/data_security_project | 46cffb38b3c4c47cb01bfb3585bf2365c77e407c | [
"MIT"
] | null | null | null | app/views/combiners_views.py | lawrence-gandhar/data_security_project | 46cffb38b3c4c47cb01bfb3585bf2365c77e407c | [
"MIT"
] | null | null | null | app/views/combiners_views.py | lawrence-gandhar/data_security_project | 46cffb38b3c4c47cb01bfb3585bf2365c77e407c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# IntegrityError Exception for checking duplicate entry,
# connection import to establish connection to database
from django.db import IntegrityError, connection
# Used for serializing object data to json string
from django.core.serializers.json impor... | 33.545455 | 104 | 0.714995 |
from __future__ import unicode_literals
from django.db import IntegrityError, connection
from django.core.serializers.json import DjangoJSONEncoder
from django.core.serializers import serialize
from django.shortcuts import render, redirect
from django.http import HttpResponse, Http404, HttpResponseForbidden, ... | true | true |
790aed47dcf309c1eef143d65af8d070cba89236 | 2,073 | py | Python | docs/source/conf.py | jeanphilippemercier/uquake-useis | fb03197852e4180ad32c6308787543b2af95f798 | [
"MIT"
] | null | null | null | docs/source/conf.py | jeanphilippemercier/uquake-useis | fb03197852e4180ad32c6308787543b2af95f798 | [
"MIT"
] | null | null | null | docs/source/conf.py | jeanphilippemercier/uquake-useis | fb03197852e4180ad32c6308787543b2af95f798 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.983607 | 79 | 0.662808 |
import os
import sys
sys.path.insert(0, os.path.abspath('../../useis'))
project = 'useis'
copyright = '2021, Jean-Philippe Mercier'
author = 'Jean-Philippe Mercier'
release = '"0.5.0"'
extensions = [
'rinoh.frontend.sphinx',
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ex... | true | true |
790aed5ae55c522da0eaaaef4bf1503de4b0e9e0 | 2,703 | py | Python | mdrsl/rule_generation/decision_tree_conversion/tree_edge.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | 3 | 2020-08-03T19:25:44.000Z | 2021-06-27T22:25:55.000Z | mdrsl/rule_generation/decision_tree_conversion/tree_edge.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | null | null | null | mdrsl/rule_generation/decision_tree_conversion/tree_edge.py | joschout/Multi-Directional-Rule-Set-Learning | ef0620b115f4e0fd7fba3e752d238a8020c1ca6b | [
"Apache-2.0"
] | 2 | 2020-08-07T22:54:28.000Z | 2021-02-18T06:11:01.000Z | from typing import List
from mdrsl.data_structures.rules.generalized_rule_part import GeneralizedAntecedent
from mdrsl.data_structures.item import Literal, NEQLiteral, EQLiteral
from mdrsl.rule_generation.decision_tree_conversion.attribute_id_to_name_conversion import DecisionTreeFeatureIDConverter
class TreeEdge:
... | 35.565789 | 121 | 0.669996 | from typing import List
from mdrsl.data_structures.rules.generalized_rule_part import GeneralizedAntecedent
from mdrsl.data_structures.item import Literal, NEQLiteral, EQLiteral
from mdrsl.rule_generation.decision_tree_conversion.attribute_id_to_name_conversion import DecisionTreeFeatureIDConverter
class TreeEdge:
... | true | true |
790aee074f72c9c74a7b392eebbb6be67947cfba | 19,204 | py | Python | app/views.py | alonlevko/seminarmiddleeast | fc0822747015485da8670b3126418819f883083b | [
"Apache-2.0"
] | null | null | null | app/views.py | alonlevko/seminarmiddleeast | fc0822747015485da8670b3126418819f883083b | [
"Apache-2.0"
] | null | null | null | app/views.py | alonlevko/seminarmiddleeast | fc0822747015485da8670b3126418819f883083b | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import json
import collections
import string
from django.http import JsonResponse, HttpResponseRedirect, HttpResponseNotFound
from django.http import Http404
from django.shortcuts import render
import threading
import json
from django.views.decorators.csrf import csrf_exempt
from... | 42.580931 | 145 | 0.64221 | from __future__ import unicode_literals
import json
import collections
import string
from django.http import JsonResponse, HttpResponseRedirect, HttpResponseNotFound
from django.http import Http404
from django.shortcuts import render
import threading
import json
from django.views.decorators.csrf import csrf_exempt
from... | true | true |
790aeefe9f2a259615a35b09061f04aa296a58d9 | 5,885 | py | Python | electrum/constants.py | dappcenter/electrum-dogecoin | ee29a07b127a4120e785c6941af9313176a3c4f3 | [
"MIT"
] | 3 | 2021-10-03T06:45:36.000Z | 2022-03-29T05:13:52.000Z | electrum/constants.py | 0xAyanami/electrum | 4c3c8b6a36f8b139625d7132d200ffbc742123b0 | [
"MIT"
] | 1 | 2022-03-29T05:20:21.000Z | 2022-03-29T21:31:06.000Z | electrum/constants.py | 0xAyanami/electrum | 4c3c8b6a36f8b139625d7132d200ffbc742123b0 | [
"MIT"
] | 4 | 2021-11-08T20:44:38.000Z | 2022-03-28T20:16:02.000Z | # -*- coding: utf-8 -*-
#
# Electrum - lightweight Dogecoin client
# Copyright (C) 2018 The Electrum developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# includ... | 27.890995 | 81 | 0.683772 |
import os
import json
from .util import inv_dict, all_subclasses
from . import bitcoin
def read_json(filename, default):
path = os.path.join(os.path.dirname(__file__), filename)
try:
with open(path, 'r') as f:
r = json.loads(f.read())
except:
r = defau... | true | true |
790af0bbaa36b748af8db96c98f4a5bb074638c4 | 1,256 | py | Python | enums.py | chenghao/haoAdmin | b627f3ead498cce29b23038c92230a63b3a0548f | [
"Apache-2.0"
] | 1 | 2017-12-15T11:27:31.000Z | 2017-12-15T11:27:31.000Z | enums.py | chenghao/haoAdmin | b627f3ead498cce29b23038c92230a63b3a0548f | [
"Apache-2.0"
] | null | null | null | enums.py | chenghao/haoAdmin | b627f3ead498cce29b23038c92230a63b3a0548f | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
__author__ = "gaunt"
import enum
# layui页面框架的表格成功标识
layui_table_code = 0
class BaseEnum(enum.Enum):
pass
class ResultEnum(BaseEnum):
success = {"code": 200, "msg": "操作成功"}
error = {"code": 500, "msg": "操作失败"}
error400 = {"code": 400, "msg": "400 - 请求参数错误"}
error401 = {"code": 4... | 22.428571 | 60 | 0.585987 |
__author__ = "gaunt"
import enum
layui_table_code = 0
class BaseEnum(enum.Enum):
pass
class ResultEnum(BaseEnum):
success = {"code": 200, "msg": "操作成功"}
error = {"code": 500, "msg": "操作失败"}
error400 = {"code": 400, "msg": "400 - 请求参数错误"}
error401 = {"code": 401, "msg": "401 - 未授权"}
erro... | true | true |
790af15b41bd54861264ce39f31388800d44dbd5 | 243 | py | Python | transformers_interpret/__init__.py | MichalMalyska/transformers-interpret | 878ec4b6928e2417a3ffe8499be52033938090f0 | [
"Apache-2.0"
] | 1 | 2021-07-06T21:07:49.000Z | 2021-07-06T21:07:49.000Z | transformers_interpret/__init__.py | MichalMalyska/transformers-interpret | 878ec4b6928e2417a3ffe8499be52033938090f0 | [
"Apache-2.0"
] | null | null | null | transformers_interpret/__init__.py | MichalMalyska/transformers-interpret | 878ec4b6928e2417a3ffe8499be52033938090f0 | [
"Apache-2.0"
] | null | null | null | from .attributions import Attributions, LIGAttributions
from .explainer import BaseExplainer
from .explainers.question_answering import QuestionAnsweringExplainer
from .explainers.sequence_classification import SequenceClassificationExplainer
| 48.6 | 79 | 0.901235 | from .attributions import Attributions, LIGAttributions
from .explainer import BaseExplainer
from .explainers.question_answering import QuestionAnsweringExplainer
from .explainers.sequence_classification import SequenceClassificationExplainer
| true | true |
790af198729099b8a1759e463889e41f0a8ccf9d | 3,343 | py | Python | tests/integration/factories/master/test_master.py | cmcmarrow/pytest-salt-factories | 12515411ea0fa11d7058a9deb61584a56c5f5108 | [
"Apache-2.0"
] | null | null | null | tests/integration/factories/master/test_master.py | cmcmarrow/pytest-salt-factories | 12515411ea0fa11d7058a9deb61584a56c5f5108 | [
"Apache-2.0"
] | null | null | null | tests/integration/factories/master/test_master.py | cmcmarrow/pytest-salt-factories | 12515411ea0fa11d7058a9deb61584a56c5f5108 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import tempfile
import pytest
@pytest.fixture(scope="module")
def master(request, salt_factories):
return salt_factories.spawn_master(request, "master-1")
@pytest.fixture(scope="module")
def minion(request, salt_factories, master):
return salt_factories.spawn_minion(reques... | 27.858333 | 81 | 0.647921 |
import os
import tempfile
import pytest
@pytest.fixture(scope="module")
def master(request, salt_factories):
return salt_factories.spawn_master(request, "master-1")
@pytest.fixture(scope="module")
def minion(request, salt_factories, master):
return salt_factories.spawn_minion(request, "minion-1", master_i... | true | true |
790af1afaa878ca8158a89e7077dc38f1aa44dcf | 3,529 | py | Python | homeassistant/components/goodwe/number.py | kubawolanin/core | ba1b09a3a52954c7cbf60df926e3c9d7a5779d99 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/goodwe/number.py | kubawolanin/core | ba1b09a3a52954c7cbf60df926e3c9d7a5779d99 | [
"Apache-2.0"
] | 10 | 2022-01-26T06:25:49.000Z | 2022-03-31T07:18:45.000Z | homeassistant/components/goodwe/number.py | swimguy81084/home-assistant | 224f9600507b8684b919164e7de4ad81a649b9cb | [
"Apache-2.0"
] | null | null | null | """GoodWe PV inverter numeric settings entities."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
import logging
from goodwe import Inverter, InverterError
from homeassistant.components.number import NumberEntity, NumberEntityDescription
from hom... | 32.081818 | 85 | 0.706999 | from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
import logging
from goodwe import Inverter, InverterError
from homeassistant.components.number import NumberEntity, NumberEntityDescription
from homeassistant.const import ENTITY_CATEGORY_CONFIG, PERC... | true | true |
790af2bda5365b4fa09f1a04fd33592582de11b3 | 584 | py | Python | tictactoe/tools/validators.py | motiejus/tictactoe | 66bb11e9a892a0c682af7c65ab08f048b52ca24b | [
"MIT"
] | 1 | 2021-04-25T10:45:27.000Z | 2021-04-25T10:45:27.000Z | tictactoe/tools/validators.py | motiejus/tictactoe | 66bb11e9a892a0c682af7c65ab08f048b52ca24b | [
"MIT"
] | 1 | 2021-06-10T19:14:37.000Z | 2021-06-10T19:14:37.000Z | tictactoe/tools/validators.py | motiejus/tictactoe | 66bb11e9a892a0c682af7c65ab08f048b52ca24b | [
"MIT"
] | null | null | null | from django.core.validators import BaseValidator
from django.utils.deconstruct import deconstructible
from django.utils.translation import ungettext_lazy
@deconstructible
class ByteLengthValidator(BaseValidator):
compare = lambda self, a, b: a > b
clean = lambda self, x: len(x.encode('utf8'))
message = un... | 34.352941 | 63 | 0.681507 | from django.core.validators import BaseValidator
from django.utils.deconstruct import deconstructible
from django.utils.translation import ungettext_lazy
@deconstructible
class ByteLengthValidator(BaseValidator):
compare = lambda self, a, b: a > b
clean = lambda self, x: len(x.encode('utf8'))
message = un... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.