hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75800a851ebd4b78b538ddbf6b853d1514ff8b2 | 8,374 | py | Python | flexget/utils/simple_persistence.py | metaMMA/Flexget | a38986422461d7935ead1e2b4ed4c88bcd0a90f5 | [
"MIT"
] | null | null | null | flexget/utils/simple_persistence.py | metaMMA/Flexget | a38986422461d7935ead1e2b4ed4c88bcd0a90f5 | [
"MIT"
] | 1 | 2017-10-09T23:06:44.000Z | 2017-10-09T23:06:44.000Z | flexget/utils/simple_persistence.py | metaMMA/Flexget | a38986422461d7935ead1e2b4ed4c88bcd0a90f5 | [
"MIT"
] | null | null | null | """
NOTE:
Avoid using this module on your own or in plugins, this was originally made for 0.9 -> 1.0 transition.
You can safely use task.simple_persistence and manager.persist, if we implement something better we
can replace underlying mechanism in single point (and provide transparent switch).
"""
from __future__ im... | 35.184874 | 115 | 0.615238 | from __future__ import unicode_literals, division, absolute_import
from builtins import *
from future.types.newstr import newstr
import logging
import pickle
from collections import MutableMapping, defaultdict
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, Unicode, select, I... | true | true |
f75801d70e00181fac27ef03101b127c9dcff0dc | 11,899 | py | Python | elliot/run.py | albertomancino/elliot | 339c6421b86646c7a5a1f5001b08a16550ed1d37 | [
"Apache-2.0"
] | null | null | null | elliot/run.py | albertomancino/elliot | 339c6421b86646c7a5a1f5001b08a16550ed1d37 | [
"Apache-2.0"
] | null | null | null | elliot/run.py | albertomancino/elliot | 339c6421b86646c7a5a1f5001b08a16550ed1d37 | [
"Apache-2.0"
] | null | null | null | """
Module description:
"""
__version__ = '0.3.1'
__author__ = 'Vito Walter Anelli, Claudio Pomo'
__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it'
import importlib
import sys
from os import path
import numpy as np
from hyperopt import Trials, fmin
import elliot.hyperoptimization as ho
from elliot.... | 53.120536 | 140 | 0.575763 |
__version__ = '0.3.1'
__author__ = 'Vito Walter Anelli, Claudio Pomo'
__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it'
import importlib
import sys
from os import path
import numpy as np
from hyperopt import Trials, fmin
import elliot.hyperoptimization as ho
from elliot.namespace.namespace_model_bui... | true | true |
f758024555b41ada391e08a9ab3d856e3a3dfe19 | 139 | py | Python | Udemy/GeekUniversity/secao_4/ex19_conversor_litros_p_metroscubicos.py | SandboxGTASA/Python-1 | bbb5f8bdf7d5110528e457b2a9ebdb2d67e40805 | [
"MIT"
] | null | null | null | Udemy/GeekUniversity/secao_4/ex19_conversor_litros_p_metroscubicos.py | SandboxGTASA/Python-1 | bbb5f8bdf7d5110528e457b2a9ebdb2d67e40805 | [
"MIT"
] | null | null | null | Udemy/GeekUniversity/secao_4/ex19_conversor_litros_p_metroscubicos.py | SandboxGTASA/Python-1 | bbb5f8bdf7d5110528e457b2a9ebdb2d67e40805 | [
"MIT"
] | null | null | null | # Convertendo litros para metro cubico
litros = float(input('Entre com um volume em litros: '))
m_cubicos = litros / 1000
print(m_cubicos) | 27.8 | 56 | 0.755396 |
litros = float(input('Entre com um volume em litros: '))
m_cubicos = litros / 1000
print(m_cubicos) | true | true |
f75802a8e5c23a79cb50a740e4eb1654569f2c46 | 1,326 | py | Python | test/test_access_policy_rule_dto.py | httpsgithu/python-client | f85a530367cdabe458a11919ad35609b9bc0606b | [
"Apache-2.0"
] | 11 | 2016-05-30T17:16:45.000Z | 2021-06-11T19:32:59.000Z | test/test_access_policy_rule_dto.py | httpsgithu/python-client | f85a530367cdabe458a11919ad35609b9bc0606b | [
"Apache-2.0"
] | 25 | 2016-05-02T23:05:19.000Z | 2020-11-18T22:43:20.000Z | test/test_access_policy_rule_dto.py | httpsgithu/python-client | f85a530367cdabe458a11919ad35609b9bc0606b | [
"Apache-2.0"
] | 30 | 2016-04-29T17:17:11.000Z | 2022-02-11T04:58:37.000Z | # coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... | 32.341463 | 409 | 0.744344 |
from __future__ import absolute_import
import unittest
import wavefront_api_client
from wavefront_api_client.models.access_policy_rule_dto import AccessPolicyRuleDTO
from wavefront_api_client.rest import ApiException
class TestAccessPolicyRuleDTO(unittest.TestCase):
def setUp(self):
pass
def... | true | true |
f75802df7430e0c7d84f3d665e1c65dfb5e5cc4e | 7,753 | py | Python | Combine/models.py | DigitalPhonetics/SpeechRepresentationFinetuning | 11d7130919888d0a27de61f5075e72f4a024673b | [
"Apache-2.0"
] | 1 | 2022-03-24T19:48:58.000Z | 2022-03-24T19:48:58.000Z | Combine/models.py | DigitalPhonetics/SpeechRepresentationFinetuning | 11d7130919888d0a27de61f5075e72f4a024673b | [
"Apache-2.0"
] | null | null | null | Combine/models.py | DigitalPhonetics/SpeechRepresentationFinetuning | 11d7130919888d0a27de61f5075e72f4a024673b | [
"Apache-2.0"
] | null | null | null | """
Adapt from:
https://github.com/facebookresearch/barlowtwins/blob/main/main.py
"""
import torch
import torch.nn as nn
from transformers import Wav2Vec2Model
from transformers.models.wav2vec2.modeling_wav2vec2 import _compute_mask_indices
def off_diagonal(x):
"""
For the purpose of calculation:
return f... | 38.572139 | 87 | 0.641429 | import torch
import torch.nn as nn
from transformers import Wav2Vec2Model
from transformers.models.wav2vec2.modeling_wav2vec2 import _compute_mask_indices
def off_diagonal(x):
n, m = x.shape
assert n == m
return x.flatten()[:-1].view(n - 1, n + 1)[:, 1:].flatten()
class BarlowTwins(nn.Module):
... | true | true |
f75802f3a3b19466b31184b6de53961aeb9cd318 | 45 | py | Python | tests/__init__.py | carverdo/scrap | d431095cadc1bc3f60aa0a3f473e726ecace9078 | [
"MIT"
] | null | null | null | tests/__init__.py | carverdo/scrap | d431095cadc1bc3f60aa0a3f473e726ecace9078 | [
"MIT"
] | null | null | null | tests/__init__.py | carverdo/scrap | d431095cadc1bc3f60aa0a3f473e726ecace9078 | [
"MIT"
] | null | null | null | __author__ = 'donal'
__project__ = 'ribcage'
| 15 | 23 | 0.733333 | __author__ = 'donal'
__project__ = 'ribcage'
| true | true |
f75806163e103395b483f9826a7477f29607f683 | 1,621 | py | Python | server_side/interfaces/database.py | yagorezende/TCC00314-Streaming | e2de185292582253106899f38540f6e523271875 | [
"Apache-2.0"
] | null | null | null | server_side/interfaces/database.py | yagorezende/TCC00314-Streaming | e2de185292582253106899f38540f6e523271875 | [
"Apache-2.0"
] | null | null | null | server_side/interfaces/database.py | yagorezende/TCC00314-Streaming | e2de185292582253106899f38540f6e523271875 | [
"Apache-2.0"
] | null | null | null | import sqlite3
from util.constants import DATABASE
class DBManager:
def __init__(self):
self.connection = None
self.cursor = None
def connect(self):
self.connection = sqlite3.connect(DATABASE["path"])
self.cursor = self.connection.cursor()
return self
def create_t... | 29.472727 | 102 | 0.636644 | import sqlite3
from util.constants import DATABASE
class DBManager:
def __init__(self):
self.connection = None
self.cursor = None
def connect(self):
self.connection = sqlite3.connect(DATABASE["path"])
self.cursor = self.connection.cursor()
return self
def create_t... | true | true |
f75806b2a456eaf32574808ca1cb89f88e997306 | 1,174 | py | Python | multinherit.py | robbroadhead/PythonCertificationSeries | 15a9907b6bd05d6419e9472b56666dacf7dc8333 | [
"CC0-1.0"
] | null | null | null | multinherit.py | robbroadhead/PythonCertificationSeries | 15a9907b6bd05d6419e9472b56666dacf7dc8333 | [
"CC0-1.0"
] | 1 | 2021-08-21T15:20:56.000Z | 2021-08-21T15:20:56.000Z | multinherit.py | robbroadhead/PythonCertificationSeries | 15a9907b6bd05d6419e9472b56666dacf7dc8333 | [
"CC0-1.0"
] | null | null | null | # Python multiple inheritance examples
class Base1:
# class properties
value = "I am base 1"
# class methods
def __init__(self,val1="I am base 1"):
print("Base 1 Constructor called")
self.value = val1
def display(self):
print("Base 1 display called")
class Base2:
# c... | 19.566667 | 42 | 0.609029 |
class Base1:
value = "I am base 1"
def __init__(self,val1="I am base 1"):
print("Base 1 Constructor called")
self.value = val1
def display(self):
print("Base 1 display called")
class Base2:
value = "I am base 2"
def __init__(self,val2="I am base 2")... | true | true |
f758077e4bdd541042768d7c9e0dc04a34aeeac5 | 2,995 | py | Python | src/intranet3/intranet3/testing/factory.py | tmodrzynski/intranet-open | 0255227e7133d1c34ab265e1418f9a409370ea3a | [
"MIT"
] | null | null | null | src/intranet3/intranet3/testing/factory.py | tmodrzynski/intranet-open | 0255227e7133d1c34ab265e1418f9a409370ea3a | [
"MIT"
] | null | null | null | src/intranet3/intranet3/testing/factory.py | tmodrzynski/intranet-open | 0255227e7133d1c34ab265e1418f9a409370ea3a | [
"MIT"
] | null | null | null | from intranet3 import models
class FactoryMixin(object):
# Current state of counter
cid = 1 # Client
uid = 1 # User
pid = 1 # Project
tid = 1 # Tracker
def create_user(
self,
name="",
domain="stxnext.pl",
groups=[],
**kwargs
):
username ... | 25.818966 | 68 | 0.49783 | from intranet3 import models
class FactoryMixin(object):
cid = 1
uid = 1
pid = 1
tid = 1
def create_user(
self,
name="",
domain="stxnext.pl",
groups=[],
**kwargs
):
username = name or "user_%s" % self.uid
user = models.User(... | true | true |
f758088a3541de401feac151c80f6da19c1e6ee0 | 2,917 | py | Python | e2e-tests/src/test_spike.py | admariner/prestige | 25ba4a9bd197671db7506bcf996be08a9bac29bd | [
"Apache-2.0"
] | null | null | null | e2e-tests/src/test_spike.py | admariner/prestige | 25ba4a9bd197671db7506bcf996be08a9bac29bd | [
"Apache-2.0"
] | 1 | 2021-11-07T06:25:37.000Z | 2021-11-07T06:25:37.000Z | e2e-tests/src/test_spike.py | admariner/prestige | 25ba4a9bd197671db7506bcf996be08a9bac29bd | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
import inspect
import os
import os.path
import unittest
from typing import Dict
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.expected_conditions import presence_of_element_l... | 30.385417 | 88 | 0.744601 | from collections import defaultdict
import inspect
import os
import os.path
import unittest
from typing import Dict
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.expected_conditions import presence_of_element_l... | true | true |
f75808f9abc52931dcbf63471d240bd6dddddced | 7,066 | py | Python | python/ray/tune/registry.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/registry.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | 12 | 2022-03-05T05:37:28.000Z | 2022-03-19T07:14:43.000Z | python/ray/tune/registry.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | import logging
import uuid
from functools import partial
from types import FunctionType
from typing import Optional, Type, Union
import ray
import ray.cloudpickle as pickle
from ray.experimental.internal_kv import (
_internal_kv_initialized,
_internal_kv_get,
_internal_kv_put,
)
from ray.tune.error import... | 29.940678 | 87 | 0.668271 | import logging
import uuid
from functools import partial
from types import FunctionType
from typing import Optional, Type, Union
import ray
import ray.cloudpickle as pickle
from ray.experimental.internal_kv import (
_internal_kv_initialized,
_internal_kv_get,
_internal_kv_put,
)
from ray.tune.error import... | true | true |
f75809cb6c7a2fad51b142c4ef8a6de72ffb1351 | 1,257 | py | Python | trigger.py | itsme180/YangBot | 30b514ca83be04c391c6fd6adaa78b2235fcd5e9 | [
"MIT"
] | null | null | null | trigger.py | itsme180/YangBot | 30b514ca83be04c391c6fd6adaa78b2235fcd5e9 | [
"MIT"
] | null | null | null | trigger.py | itsme180/YangBot | 30b514ca83be04c391c6fd6adaa78b2235fcd5e9 | [
"MIT"
] | null | null | null | #YangBot's responses
choiced_responses = {
"dank": "I sure hope you're talking about dank memes and not that dank green!",
"blaze": "I sure hope you're talking about the pizza!",
"alcohol": "Reminder that underage drinking is prohibited at UCSB.", #should only be triggered by gauchito
"mj": "Despite the passin... | 44.892857 | 121 | 0.667462 |
choiced_responses = {
"dank": "I sure hope you're talking about dank memes and not that dank green!",
"blaze": "I sure hope you're talking about the pizza!",
"alcohol": "Reminder that underage drinking is prohibited at UCSB.", #should only be triggered by gauchito
"mj": "Despite the passing of Prop 64, marijua... | true | true |
f7580a9344062f756c81c1cf703504388e2ef763 | 32,087 | py | Python | src/ClusterBootstrap/params.py | leigaoms/DLWorkspace | f8bdf5bb5b6c372eae60f6e52f072b4d7e46babc | [
"MIT"
] | null | null | null | src/ClusterBootstrap/params.py | leigaoms/DLWorkspace | f8bdf5bb5b6c372eae60f6e52f072b4d7e46babc | [
"MIT"
] | null | null | null | src/ClusterBootstrap/params.py | leigaoms/DLWorkspace | f8bdf5bb5b6c372eae60f6e52f072b4d7e46babc | [
"MIT"
] | null | null | null | # These are the default configuration parameter
default_config_parameters = {
"allroles": {"infra", "infrastructure", "worker", "nfs", "sql", "dev"},
# Kubernetes setting
"service_cluster_ip_range": "10.3.0.0/16",
"pod_ip_range": "10.2.0.0/16",
# Home in server, to aide Kubernete setup
"homeinse... | 38.612515 | 210 | 0.557827 |
default_config_parameters = {
"allroles": {"infra", "infrastructure", "worker", "nfs", "sql", "dev"},
"service_cluster_ip_range": "10.3.0.0/16",
"pod_ip_range": "10.2.0.0/16",
"homeinserver": "http://dlws-clusterportal.westus.cloudapp.azure.com:5000",
"cloud_influxdb_node": "dlws-influxdb... | true | true |
f7580b00bc3786e8b8713b9222431d5469f10a9d | 24,477 | py | Python | selfdrive/car/toyota/values.py | lulflr/openpilot_arne | 403277b1bb2cf6c387ac961b59fddbc48dc36fd4 | [
"MIT"
] | null | null | null | selfdrive/car/toyota/values.py | lulflr/openpilot_arne | 403277b1bb2cf6c387ac961b59fddbc48dc36fd4 | [
"MIT"
] | null | null | null | selfdrive/car/toyota/values.py | lulflr/openpilot_arne | 403277b1bb2cf6c387ac961b59fddbc48dc36fd4 | [
"MIT"
] | null | null | null | from selfdrive.car import dbc_dict
class CAR:
PRIUS = "TOYOTA PRIUS 2017"
RAV4H = "TOYOTA RAV4 HYBRID 2017"
RAV4 = "TOYOTA RAV4 2017"
COROLLA = "TOYOTA COROLLA 2017"
LEXUS_RXH = "LEXUS RX HYBRID 2017"
CHR = "TOYOTA C-HR 2018"
CHRH = "TOYOTA C-HR HYBRID 2018"
CAMRY = "TOYOTA CAMRY 2018"
CAMRYH = "TOYO... | 143.982353 | 1,124 | 0.570372 | from selfdrive.car import dbc_dict
class CAR:
PRIUS = "TOYOTA PRIUS 2017"
RAV4H = "TOYOTA RAV4 HYBRID 2017"
RAV4 = "TOYOTA RAV4 2017"
COROLLA = "TOYOTA COROLLA 2017"
LEXUS_RXH = "LEXUS RX HYBRID 2017"
CHR = "TOYOTA C-HR 2018"
CHRH = "TOYOTA C-HR HYBRID 2018"
CAMRY = "TOYOTA CAMRY 2018"
CAMRYH = "TOYO... | true | true |
f7580d05d35d71dfa3af6814208eba400f22a8fa | 97 | py | Python | code/__init__.py | alejandropages/KernelPheno | 5a8d1fc8892b5cbc1309d42261596d12402c545c | [
"MIT"
] | null | null | null | code/__init__.py | alejandropages/KernelPheno | 5a8d1fc8892b5cbc1309d42261596d12402c545c | [
"MIT"
] | 1 | 2020-12-04T02:34:43.000Z | 2020-12-04T02:34:43.000Z | code/__init__.py | alejandropages/KernelPheno | 5a8d1fc8892b5cbc1309d42261596d12402c545c | [
"MIT"
] | null | null | null | # from os import path
#
# os.environ['KERNEL_PHENO_PATH'] = path.dirname(path.dirname(__file__))
| 24.25 | 72 | 0.742268 | true | true | |
f7580d83bd3da94d9f79c58a4cd115c036ca04d0 | 479 | py | Python | omdb/migrations/0004_alter_video_year.py | Kyle1297/fetchtv-imdb | da6e0a05d51f91111f161372399f8078bd119571 | [
"MIT"
] | 1 | 2021-07-02T04:39:13.000Z | 2021-07-02T04:39:13.000Z | omdb/migrations/0004_alter_video_year.py | Kyle1297/fetchtv-omdb | da6e0a05d51f91111f161372399f8078bd119571 | [
"MIT"
] | null | null | null | omdb/migrations/0004_alter_video_year.py | Kyle1297/fetchtv-omdb | da6e0a05d51f91111f161372399f8078bd119571 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-28 11:05
from django.db import migrations, models
import omdb.models
class Migration(migrations.Migration):
dependencies = [
('omdb', '0003_alter_video_year'),
]
operations = [
migrations.AlterField(
model_name='video',
name... | 23.95 | 132 | 0.638831 |
from django.db import migrations, models
import omdb.models
class Migration(migrations.Migration):
dependencies = [
('omdb', '0003_alter_video_year'),
]
operations = [
migrations.AlterField(
model_name='video',
name='year',
field=models.CharField(db_... | true | true |
f7580dc7742ac4f132ac99a0fe9bd02396a03344 | 6,702 | py | Python | bindings/python/ensmallen_graph/datasets/string/bartonellaclarridgeiae.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/bartonellaclarridgeiae.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/bartonellaclarridgeiae.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Bartonella clarridgeiae.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 202... | 35.460317 | 223 | 0.704417 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def BartonellaClarridgeiae(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f7580ef8e7f8c073c89f211af94a37d5e210ecf4 | 547 | py | Python | backend/migrations/0004_rule_service.py | guhuajun/grafana-awssns | 6f1f8e33e86b97ed83575d8b1c2b601ebd3f8b38 | [
"MIT"
] | 6 | 2018-08-30T16:29:04.000Z | 2020-09-22T04:08:44.000Z | backend/migrations/0004_rule_service.py | guhuajun/grafana-awssns | 6f1f8e33e86b97ed83575d8b1c2b601ebd3f8b38 | [
"MIT"
] | 1 | 2018-05-23T02:13:42.000Z | 2018-05-31T14:56:23.000Z | backend/migrations/0004_rule_service.py | guhuajun/grafana-awssns | 6f1f8e33e86b97ed83575d8b1c2b601ebd3f8b38 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2017-12-24 05:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0003_awscredential'),
]
operations = [
... | 24.863636 | 121 | 0.650823 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0003_awscredential'),
]
operations = [
migrations.AddField(
model_name='rule',
... | true | true |
f7580f1f000dc280b7957408ed316744fd17b49d | 775 | py | Python | 007er_pyserver/db_repository/versions/019_migration.py | Lidagou007er/lidagou007er.github.io | 25ffb8d84ad6ef9ece8ee9f458c299d06f1742f9 | [
"MIT"
] | null | null | null | 007er_pyserver/db_repository/versions/019_migration.py | Lidagou007er/lidagou007er.github.io | 25ffb8d84ad6ef9ece8ee9f458c299d06f1742f9 | [
"MIT"
] | null | null | null | 007er_pyserver/db_repository/versions/019_migration.py | Lidagou007er/lidagou007er.github.io | 25ffb8d84ad6ef9ece8ee9f458c299d06f1742f9 | [
"MIT"
] | null | null | null | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
the__writer = Table('the__writer', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('id007', String(length=25)),
Column('name', String(length=25)),
)
... | 27.678571 | 68 | 0.730323 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
the__writer = Table('the__writer', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('id007', String(length=25)),
Column('name', String(length=25)),
)
... | true | true |
f75810e63ee1da347550cf37a4904e6e183cd014 | 528 | py | Python | search/migrations/0008_auto_20161031_0540.py | lfaraone/sal | d0dff90cebcbc87f18c2c6957264f21566d52000 | [
"Apache-2.0"
] | 1 | 2019-11-01T20:54:47.000Z | 2019-11-01T20:54:47.000Z | search/migrations/0008_auto_20161031_0540.py | grahamgilbert/sal | d247ec1ea8855e65e5855b0dd63eae93b40f86ca | [
"Apache-2.0"
] | null | null | null | search/migrations/0008_auto_20161031_0540.py | grahamgilbert/sal | d247ec1ea8855e65e5855b0dd63eae93b40f86ca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-31 12:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('search', '0007_auto_20161031_0405'),
]
operations = [
migrations.AlterField(
... | 24 | 91 | 0.613636 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('search', '0007_auto_20161031_0405'),
]
operations = [
migrations.AlterField(
model_name='savedsearch',
name='name',
... | true | true |
f75811a07314d014269c56461afe96260f07b99e | 495 | py | Python | MeArmValetSystem/test/password testing (1).py | Thoybur-Rohman/MeArm-keyValet-storageSystem | 6863ce4c0deaeea195bc99b0931ecbb6a562a077 | [
"Apache-2.0"
] | null | null | null | MeArmValetSystem/test/password testing (1).py | Thoybur-Rohman/MeArm-keyValet-storageSystem | 6863ce4c0deaeea195bc99b0931ecbb6a562a077 | [
"Apache-2.0"
] | null | null | null | MeArmValetSystem/test/password testing (1).py | Thoybur-Rohman/MeArm-keyValet-storageSystem | 6863ce4c0deaeea195bc99b0931ecbb6a562a077 | [
"Apache-2.0"
] | null | null | null | import serial # Allows you to talk to the Arduino board
# Select port, yours may be different so check the port for your board
usbport = 'COM4'
# create a serial object
ser = serial.Serial(usbport, 9600, timeout=1)
while True:
servo = raw_input("enter servo Nbr (0-3)")
position = raw_input("ent... | 21.521739 | 73 | 0.6 | import serial
usbport = 'COM4'
ser = serial.Serial(usbport, 9600, timeout=1)
while True:
servo = raw_input("enter servo Nbr (0-3)")
position = raw_input("enter angle between 10 and 170:")
cmd = servo + "," + position + "\n"
ser.write(cmd)
def move(s,p):
cmd = s + "," + p... | true | true |
f75811b0c3651dc50b0a01a9e47bf55e8a7de5df | 22,625 | py | Python | kubernetes/client/models/v1_service_spec.py | iamneha/python | 5b208a1a49a8d6f8bbab28bcc226b9ef793bcbd0 | [
"Apache-2.0"
] | 1 | 2019-02-17T15:28:39.000Z | 2019-02-17T15:28:39.000Z | kubernetes/client/models/v1_service_spec.py | iamneha/python | 5b208a1a49a8d6f8bbab28bcc226b9ef793bcbd0 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_service_spec.py | iamneha/python | 5b208a1a49a8d6f8bbab28bcc226b9ef793bcbd0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 48.866091 | 886 | 0.70232 |
from pprint import pformat
from six import iteritems
import re
class V1ServiceSpec(object):
swagger_types = {
'cluster_ip': 'str',
'external_i_ps': 'list[str]',
'external_name': 'str',
'external_traffic_policy': 'str',
'health_check_node_port': 'int',
'load_ba... | true | true |
f758121ed7b3a4d04e9654526ca5de728c4a2602 | 123 | py | Python | api/admin.py | Uttam-Singhh/Movie-Rater | 3c604a1d7554643a3edd0d11b07231679ae4695b | [
"MIT"
] | 1 | 2020-04-11T04:23:06.000Z | 2020-04-11T04:23:06.000Z | api/admin.py | Uttam-Singhh/Movie-Rater | 3c604a1d7554643a3edd0d11b07231679ae4695b | [
"MIT"
] | 11 | 2020-02-12T03:16:23.000Z | 2022-02-26T21:41:31.000Z | api/admin.py | Uttam-Singhh/Movie-Rater | 3c604a1d7554643a3edd0d11b07231679ae4695b | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Movie, Rating
admin.site.register(Movie)
admin.site.register(Rating)
| 20.5 | 33 | 0.813008 | from django.contrib import admin
from .models import Movie, Rating
admin.site.register(Movie)
admin.site.register(Rating)
| true | true |
f75812fb05cd197c4968dd572a41caf727fb05fa | 12,206 | py | Python | hub_module/modules/image/text_recognition/chinese_text_detection_db_server/module.py | HawChang/PaddleHub | 7faf09eb423b7c844392e6fa19b9b8db49928835 | [
"Apache-2.0"
] | 2 | 2020-11-30T08:54:01.000Z | 2021-04-07T10:11:36.000Z | hub_module/modules/image/text_recognition/chinese_text_detection_db_server/module.py | haoyuying/PaddleHub | 9894fbb1dc8575ae1fa74f32a23cc1363467461b | [
"Apache-2.0"
] | null | null | null | hub_module/modules/image/text_recognition/chinese_text_detection_db_server/module.py | haoyuying/PaddleHub | 9894fbb1dc8575ae1fa74f32a23cc1363467461b | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import ast
import math
import os
import time
from paddle.fluid.core import AnalysisConfig, create_paddle_predictor, PaddleTensor
from paddlehub.common.logger import logge... | 36.54491 | 187 | 0.587744 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import ast
import math
import os
import time
from paddle.fluid.core import AnalysisConfig, create_paddle_predictor, PaddleTensor
from paddlehub.common.logger import logger
from paddlehub.modul... | true | true |
f758136d72f620051c37a60491babd4e806e6b19 | 3,561 | py | Python | src/data/fetch_database.py | SoulaimenTheGreat/Wine-Prediction | 0e692ee430c09f90e7b49a3d3fb6450b6e25b663 | [
"MIT"
] | null | null | null | src/data/fetch_database.py | SoulaimenTheGreat/Wine-Prediction | 0e692ee430c09f90e7b49a3d3fb6450b6e25b663 | [
"MIT"
] | null | null | null | src/data/fetch_database.py | SoulaimenTheGreat/Wine-Prediction | 0e692ee430c09f90e7b49a3d3fb6450b6e25b663 | [
"MIT"
] | null | null | null | # import motor.motor_asyncio
from pymongo import MongoClient
from dotenv import load_dotenv
import os
import pandas as pd
from dagster import solid
def load_env_variables():
"""
Function to load environment variables from .env file
:return: database password and database name
"""
load_dotenv()
... | 40.011236 | 122 | 0.679584 |
from pymongo import MongoClient
from dotenv import load_dotenv
import os
import pandas as pd
from dagster import solid
def load_env_variables():
load_dotenv()
database_password = os.environ.get('PASSWORD')
database_name = os.environ.get('DATABASE')
return database_password, database_name
def config... | true | true |
f75813d6e7fab2d7ca05675b345cd90340b7c22e | 2,487 | py | Python | docs/conf.py | yukkun007/mmbooks | 4a05951ee30e33295b1b4c0b578f02ad6a4a20a5 | [
"MIT"
] | null | null | null | docs/conf.py | yukkun007/mmbooks | 4a05951ee30e33295b1b4c0b578f02ad6a4a20a5 | [
"MIT"
] | 41 | 2021-10-08T05:55:21.000Z | 2022-03-28T23:14:22.000Z | docs/conf.py | mozkzki/moz-books | 75fd44041ea8cb4cfe283fa5452443dbaaa4d732 | [
"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... | 34.068493 | 79 | 0.652191 |
import sys
sys.path.insert(0, "../src/moz_books")
project = "moz_books"
copyright = "2021, Author"
author = "Author"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
]
templates_path = ["_templates"]
language = "en"
exclude_patterns = ["_bui... | true | true |
f75813ee1cd91d75187d16fced55c6146c03a419 | 6,418 | py | Python | pykey/__init__.py | jpconstantineau/CircuitPython_pykey | 3b0c6ca52e4e693f7c4d0a4c25797dd05a301b24 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | pykey/__init__.py | jpconstantineau/CircuitPython_pykey | 3b0c6ca52e4e693f7c4d0a4c25797dd05a301b24 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | pykey/__init__.py | jpconstantineau/CircuitPython_pykey | 3b0c6ca52e4e693f7c4d0a4c25797dd05a301b24 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Pierre Constantineau for jpconstantineau.com
#
# SPDX-License-Identifier: MIT
"""
`pykey`
================================================================================
keyboard hardware drive... | 36.05618 | 100 | 0.630259 |
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/jpconstantineau/CircuitPython_pykey.git"
import os
import usb_hid
from adafruit_hid.keyboard import Keyboard
from BitmapKeyboard import BitmapKeyboard
class KB_Hardware:
def __init__(self, nkro: bool = False):
self._board_type = os.uname... | true | true |
f758151c3a284214e61a109d6c60138ce2b4d38c | 2,920 | py | Python | algorithms/miniumum_edit_distance.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | algorithms/miniumum_edit_distance.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | algorithms/miniumum_edit_distance.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | """
Created by Joseph Edradan
Github: https://github.com/josephedradan
Date created: 2/15/2021
Purpose:
Details:
Description:
Notes:
IMPORTANT NOTES:
Explanation:
Reference:
Minimum Edit Distance Algorithm in Python in 2020 (EXPLAINED)
Notes:
Using Rylan Fowers' minimum edit distance alg... | 28.349515 | 115 | 0.59726 |
import numpy as np
import pandas as pd
def min_edit_distance_fowers(source, target):
list_source_char = [c for c in source]
list_target_char = [c for c in target]
np_array = np.zeros((len(source), len(target)))
np_array[0] = [c for c in range(len(target))]
np_array[:, 0] = [c fo... | true | true |
f75815ee384de002b0fe9e06fe785367b505c291 | 927 | py | Python | src/utils.py | MahdiSajedei/Searching-for-activation-functions | 031ef131df7fe84fa2cafadc946b5a33df8925ec | [
"MIT"
] | 32 | 2018-01-29T07:31:41.000Z | 2022-03-19T11:02:00.000Z | src/utils.py | MahdiSajedei/Searching-for-activation-functions | 031ef131df7fe84fa2cafadc946b5a33df8925ec | [
"MIT"
] | 1 | 2020-01-21T17:23:18.000Z | 2020-01-21T17:23:18.000Z | src/utils.py | MahdiSajedei/Searching-for-activation-functions | 031ef131df7fe84fa2cafadc946b5a33df8925ec | [
"MIT"
] | 15 | 2018-03-30T02:14:42.000Z | 2021-07-21T08:20:57.000Z | import os
import shutil
import numpy as np
import tensorflow as tf
def path_exists(path, overwrite=False):
if not os.path.isdir(path):
os.mkdir(path)
elif overwrite == True :
shutil.rmtree(path)
return path
def remove_dir(path):
os.rmdir(path)
return True
def relu_init(shape, dtyp... | 25.75 | 87 | 0.699029 | import os
import shutil
import numpy as np
import tensorflow as tf
def path_exists(path, overwrite=False):
if not os.path.isdir(path):
os.mkdir(path)
elif overwrite == True :
shutil.rmtree(path)
return path
def remove_dir(path):
os.rmdir(path)
return True
def relu_init(shape, dtyp... | true | true |
f75815f4413cde337fb466fe129fed8e96bf58da | 4,804 | py | Python | newscrawler/record.py | gem763/crawly | df41e5fc67a4e5092120a1bfe459d57e201849b8 | [
"MIT"
] | null | null | null | newscrawler/record.py | gem763/crawly | df41e5fc67a4e5092120a1bfe459d57e201849b8 | [
"MIT"
] | 8 | 2021-03-31T19:21:03.000Z | 2022-03-12T00:04:28.000Z | newscrawler/record.py | gem763/crawly | df41e5fc67a4e5092120a1bfe459d57e201849b8 | [
"MIT"
] | null | null | null | import pandas as pd
import pandas_gbq as gbq
import json
from google.oauth2 import service_account
from IPython.core.debugger import set_trace
from pathlib import Path
import time
from . import accounts
'''
Configuration
'''
proj = 'global-news-crawl'
table_downloaded = 'news_dataset.downloaded'
table_trashed = 'news_... | 35.585185 | 134 | 0.614072 | import pandas as pd
import pandas_gbq as gbq
import json
from google.oauth2 import service_account
from IPython.core.debugger import set_trace
from pathlib import Path
import time
from . import accounts
proj = 'global-news-crawl'
table_downloaded = 'news_dataset.downloaded'
table_trashed = 'news_dataset.trashed'
crede... | true | true |
f75816ccc85e7dd6ca1b9a6dcb68a3b4d9dcfe2c | 8,780 | py | Python | ConcodeDecoder.py | sriniiyer/concode | 864e30807f6988731ac3b4b98af6562c18bb42ff | [
"MIT"
] | 48 | 2018-09-13T15:42:30.000Z | 2022-03-14T06:45:48.000Z | ConcodeDecoder.py | sriniiyer/concode | 864e30807f6988731ac3b4b98af6562c18bb42ff | [
"MIT"
] | 5 | 2021-01-25T13:58:32.000Z | 2022-01-29T19:02:36.000Z | ConcodeDecoder.py | sriniiyer/concode | 864e30807f6988731ac3b4b98af6562c18bb42ff | [
"MIT"
] | 12 | 2018-10-05T20:12:38.000Z | 2021-12-13T13:50:25.000Z | import torch
from torch import nn
from GlobalAttention import GlobalAttention
from torch.autograd import Variable
from Beam import TreeBeam
from UtilClass import bottle, unbottle
from preprocess import rhs, CDDataset
from decoders import DecoderState, Prediction
import torch.nn.functional as F
class ConcodeDecoder(nn.... | 36.736402 | 145 | 0.667995 | import torch
from torch import nn
from GlobalAttention import GlobalAttention
from torch.autograd import Variable
from Beam import TreeBeam
from UtilClass import bottle, unbottle
from preprocess import rhs, CDDataset
from decoders import DecoderState, Prediction
import torch.nn.functional as F
class ConcodeDecoder(nn.... | true | true |
f75816f7c496d58a2a1a60b4b6053935a0896a2c | 5,564 | py | Python | fastai/text/learner.py | bhoomit/fastai | 45c8e42bffd8d6cb4c9dc709136be566666f21b3 | [
"Apache-2.0"
] | 2 | 2019-03-06T23:19:16.000Z | 2020-08-12T23:44:31.000Z | fastai/text/learner.py | bhoomit/fastai | 45c8e42bffd8d6cb4c9dc709136be566666f21b3 | [
"Apache-2.0"
] | null | null | null | fastai/text/learner.py | bhoomit/fastai | 45c8e42bffd8d6cb4c9dc709136be566666f21b3 | [
"Apache-2.0"
] | 1 | 2019-04-03T03:05:21.000Z | 2019-04-03T03:05:21.000Z | 'Model training for NLP'
from ..torch_core import *
from ..basic_train import *
from ..callbacks import *
from ..basic_data import *
from ..datasets import untar_data
from ..metrics import accuracy
from ..train import GradientClipping
from .models import get_language_model, get_rnn_classifier
__all__ = ['RNNLearner', ... | 51.518519 | 121 | 0.65115 | from ..torch_core import *
from ..basic_train import *
from ..callbacks import *
from ..basic_data import *
from ..datasets import untar_data
from ..metrics import accuracy
from ..train import GradientClipping
from .models import get_language_model, get_rnn_classifier
__all__ = ['RNNLearner', 'convert_weights', 'lm_sp... | true | true |
f7581702a8ac66acacb236779e5e1be9b774027c | 2,488 | py | Python | penaltymodel_maxgap/penaltymodel/maxgap/interface.py | hhtong/penaltymodel | 95ba784392b688be0456676e2ecfa78aa041504f | [
"Apache-2.0"
] | 15 | 2018-01-03T18:48:56.000Z | 2021-11-05T08:24:22.000Z | penaltymodel_maxgap/penaltymodel/maxgap/interface.py | hhtong/penaltymodel | 95ba784392b688be0456676e2ecfa78aa041504f | [
"Apache-2.0"
] | 77 | 2017-12-15T01:23:35.000Z | 2022-01-07T23:41:58.000Z | penaltymodel_maxgap/penaltymodel/maxgap/interface.py | hhtong/penaltymodel | 95ba784392b688be0456676e2ecfa78aa041504f | [
"Apache-2.0"
] | 17 | 2017-12-15T00:47:34.000Z | 2022-01-26T06:07:13.000Z | # Copyright 2019 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.134328 | 99 | 0.657154 |
import penaltymodel.core as pm
import dimod
from penaltymodel.maxgap.generation import generate
__all__ = 'get_penalty_model',
@pm.penaltymodel_factory(-100)
def get_penalty_model(specification):
feasible_configurations = specification.feasible_configurations
if specification.vartype ... | true | true |
f7581756a639473fcc030ce428c5f9572dbd8f46 | 463 | py | Python | users/forms.py | pauloaugusto-dmf/blog_django | 7374e85dd4f0622aefbbb99d27ceb85f19fd1cd8 | [
"MIT"
] | 2 | 2021-12-31T22:14:31.000Z | 2021-12-31T22:14:34.000Z | users/forms.py | pauloaugusto-dmf/blog_django | 7374e85dd4f0622aefbbb99d27ceb85f19fd1cd8 | [
"MIT"
] | null | null | null | users/forms.py | pauloaugusto-dmf/blog_django | 7374e85dd4f0622aefbbb99d27ceb85f19fd1cd8 | [
"MIT"
] | null | null | null | from django.contrib.auth import forms
from django.forms import ModelForm
from .models import User
class UserChangeForm(forms.UserChangeForm):
class Meta(forms.UserChangeForm.Meta):
model = User
class UserCreationForm(forms.UserCreationForm):
class Meta(forms.UserCreationForm.Meta):
model = ... | 22.047619 | 65 | 0.712743 | from django.contrib.auth import forms
from django.forms import ModelForm
from .models import User
class UserChangeForm(forms.UserChangeForm):
class Meta(forms.UserChangeForm.Meta):
model = User
class UserCreationForm(forms.UserCreationForm):
class Meta(forms.UserCreationForm.Meta):
model = ... | true | true |
f758176ad2c5da0914a6ec7dc1d5061e8e166bfa | 6,537 | py | Python | moto/ecr/responses.py | harveywi/moto | 3a5d857a60c3a2d140ed2c8adfe8dcaf71a4cac8 | [
"Apache-2.0"
] | 2 | 2018-01-29T14:50:38.000Z | 2018-05-12T10:45:31.000Z | moto/ecr/responses.py | harveywi/moto | 3a5d857a60c3a2d140ed2c8adfe8dcaf71a4cac8 | [
"Apache-2.0"
] | 2 | 2021-03-31T20:15:51.000Z | 2021-12-13T20:50:52.000Z | moto/ecr/responses.py | harveywi/moto | 3a5d857a60c3a2d140ed2c8adfe8dcaf71a4cac8 | [
"Apache-2.0"
] | 12 | 2017-09-06T22:11:15.000Z | 2021-05-28T17:22:31.000Z | from __future__ import unicode_literals
import json
from base64 import b64encode
from datetime import datetime
import time
from moto.core.responses import BaseResponse
from .models import ecr_backends, DEFAULT_REGISTRY_ID
class ECRResponse(BaseResponse):
@property
def ecr_backend(self):
return ecr_ba... | 38.005814 | 113 | 0.666667 | from __future__ import unicode_literals
import json
from base64 import b64encode
from datetime import datetime
import time
from moto.core.responses import BaseResponse
from .models import ecr_backends, DEFAULT_REGISTRY_ID
class ECRResponse(BaseResponse):
@property
def ecr_backend(self):
return ecr_ba... | true | true |
f758186667be75f302ba0b1628b0621e1c28205f | 818 | py | Python | cloudify_types/cloudify_types/component/constants.py | cloudify-cosmo/cloudify-manager | 4a3f44ceb49d449bc5ebc8766b1c7b9c174ff972 | [
"Apache-2.0"
] | 124 | 2015-01-22T22:28:37.000Z | 2022-02-26T23:12:06.000Z | cloudify_types/cloudify_types/component/constants.py | cloudify-cosmo/cloudify-manager | 4a3f44ceb49d449bc5ebc8766b1c7b9c174ff972 | [
"Apache-2.0"
] | 345 | 2015-01-08T15:49:40.000Z | 2022-03-29T08:33:00.000Z | cloudify_types/cloudify_types/component/constants.py | cloudify-cosmo/cloudify-manager | 4a3f44ceb49d449bc5ebc8766b1c7b9c174ff972 | [
"Apache-2.0"
] | 77 | 2015-01-07T14:04:35.000Z | 2022-03-07T22:46:00.000Z | # Copyright (c) 2017-2019 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 35.565217 | 74 | 0.777506 |
DEPLOYMENTS_TIMEOUT = 120
EXECUTIONS_TIMEOUT = 1800
POLLING_INTERVAL = 1
PAGINATION_SIZE = 1000
DEPLOYMENTS_CREATE_RETRIES = 10
EXTERNAL_RESOURCE = 'external_resource'
CAPABILITIES = 'capabilities'
| true | true |
f75818a308758a092e5fd60625f2e765ffbcb636 | 18,665 | py | Python | v0.7.1/autopilotrpc/autopilot_pb2.py | lncm/lnd-proto | 8caa6558efe043413560f807ef44b11699901d76 | [
"MIT"
] | 2 | 2020-02-10T09:46:06.000Z | 2020-04-09T19:30:30.000Z | v0.7.1/autopilotrpc/autopilot_pb2.py | lncm/lnd-rpc | 8caa6558efe043413560f807ef44b11699901d76 | [
"MIT"
] | 1 | 2020-02-04T16:34:35.000Z | 2020-02-04T16:34:35.000Z | v0.7.1/autopilotrpc/autopilot_pb2.py | lncm/lnd-proto | 8caa6558efe043413560f807ef44b11699901d76 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: autopilotrpc/autopilot.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import refle... | 35.150659 | 1,656 | 0.769569 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db =... | true | true |
f7581b0ec4544d6a4d8882b78f87009eb79f1a99 | 1,674 | py | Python | stonehenge_ascii_art.py | RachaelAva1024/stonehenge_ascii_art_py | 263e9e56ccbeeea7e624a288f608c1d2fbd30ad2 | [
"MIT"
] | null | null | null | stonehenge_ascii_art.py | RachaelAva1024/stonehenge_ascii_art_py | 263e9e56ccbeeea7e624a288f608c1d2fbd30ad2 | [
"MIT"
] | null | null | null | stonehenge_ascii_art.py | RachaelAva1024/stonehenge_ascii_art_py | 263e9e56ccbeeea7e624a288f608c1d2fbd30ad2 | [
"MIT"
] | null | null | null | # MARK: - Licensing Information
# MIT License
# Copyright © 2022 Wolftail Software, Rachael Ava
# MARK: - Acknowledgements
# Stonehenge ASCII Artwork by lgbeard.
# MARK: - Print Command
print(" .-----------. .------------.\n :`.__________` :`.____________` .-----.._\n ... | 139.5 | 1,474 | 0.207288 |
print(" .-----------. .------------.\n :`.__________` :`.____________` .-----.._\n '.'_.------._.' `.|__.-------..' |`-..___.'|\n | ||__..| | |-._ __ | | |.... || |-._`--..__ |.'---.\n .::/ / | | | | ___ `-| | | _ || | | | | | | \\ ... | true | true |
f7581c3c8cad484f92ece87f8f1b92a2d3e3315c | 1,954 | py | Python | Ejemplos/NotasFunciones/app/__init__.py | ampotty/uip-pc3 | 8362680226df6629791e7a4c6cdf1b738eadc5de | [
"MIT"
] | 10 | 2015-10-27T18:29:06.000Z | 2019-04-03T04:05:31.000Z | Ejemplos/NotasFunciones/app/__init__.py | abdelgmartinezl/uip-pc3 | 8362680226df6629791e7a4c6cdf1b738eadc5de | [
"MIT"
] | 5 | 2015-10-13T01:12:51.000Z | 2016-10-08T18:01:17.000Z | Ejemplos/NotasFunciones/app/__init__.py | ampotty/uip-pc3 | 8362680226df6629791e7a4c6cdf1b738eadc5de | [
"MIT"
] | 25 | 2015-09-19T00:40:17.000Z | 2018-02-08T02:54:55.000Z | notas = []
def menu():
print("\nSISTEMA DE NOTAS\n")
print("1. Ingresar nota")
print("2. Cambiar nota")
print("3. Ver notas")
print("4. Estado final")
print("5. Salir")
while True:
try:
opcion = int(input("\nOPCION > "))
except:
opcion = -1
i... | 19.156863 | 68 | 0.452405 | notas = []
def menu():
print("\nSISTEMA DE NOTAS\n")
print("1. Ingresar nota")
print("2. Cambiar nota")
print("3. Ver notas")
print("4. Estado final")
print("5. Salir")
while True:
try:
opcion = int(input("\nOPCION > "))
except:
opcion = -1
i... | true | true |
f7581c8b846fd9de9dcdd1e8c19cb593ed1e4f94 | 1,509 | py | Python | test/test_api.py | frodo19/script.module.inputstreamhelper | 123e3f4050a888adb864d5e46ca7bdaa63da1a5f | [
"MIT"
] | null | null | null | test/test_api.py | frodo19/script.module.inputstreamhelper | 123e3f4050a888adb864d5e46ca7bdaa63da1a5f | [
"MIT"
] | null | null | null | test/test_api.py | frodo19/script.module.inputstreamhelper | 123e3f4050a888adb864d5e46ca7bdaa63da1a5f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# pylint: disable=invalid-name,missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import... | 30.795918 | 103 | 0.670643 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
import default
xbmc = __import__('xbmc')
xbmcaddon = __import__('xbmcaddon')
xbmcgui = __import__('xbmcgui')
xbmcvfs = __import__('xbmcvfs')
class TestApi(unittest.TestCase):
@staticmethod
def ... | true | true |
f7581e010f3ff7f2eeacc2ecbeeb13ecfccd7975 | 2,129 | py | Python | Data Structures/Heap/heap.py | DiAshish/HacktoberFestContribute | 92e6da7736fc53af135e09c5e144293c244dc427 | [
"MIT"
] | null | null | null | Data Structures/Heap/heap.py | DiAshish/HacktoberFestContribute | 92e6da7736fc53af135e09c5e144293c244dc427 | [
"MIT"
] | null | null | null | Data Structures/Heap/heap.py | DiAshish/HacktoberFestContribute | 92e6da7736fc53af135e09c5e144293c244dc427 | [
"MIT"
] | null | null | null | class BinaryHeap(object):
def __init__(self):
self.heap = [0]
self.currentSize = 0
def __repr__(self):
heap = self.heap[1:]
return ' '.join(str(i) for i in heap)
# for shifting the node up
def shiftUp(self, index):
while (index // 2) > 0:
if self.hea... | 29.985915 | 95 | 0.537341 | class BinaryHeap(object):
def __init__(self):
self.heap = [0]
self.currentSize = 0
def __repr__(self):
heap = self.heap[1:]
return ' '.join(str(i) for i in heap)
def shiftUp(self, index):
while (index // 2) > 0:
if self.heap[index] < self.heap[index... | true | true |
f7581e57e08880651f6ffda9080d5a651d105149 | 3,491 | py | Python | el737.py | michele-brambilla/sinq-amorsim-control | a83e491f932ae8bbd53f296c0b9bcd9d2dd4bcdb | [
"BSD-2-Clause"
] | null | null | null | el737.py | michele-brambilla/sinq-amorsim-control | a83e491f932ae8bbd53f296c0b9bcd9d2dd4bcdb | [
"BSD-2-Clause"
] | null | null | null | el737.py | michele-brambilla/sinq-amorsim-control | a83e491f932ae8bbd53f296c0b9bcd9d2dd4bcdb | [
"BSD-2-Clause"
] | null | null | null | import Tkinter, tkFileDialog
import socket
import sys
class Connector:
def __init__(self):
self.connected = False
def connect(self,host,port):
if not self.connected:
try:
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... | 29.584746 | 79 | 0.539673 | import Tkinter, tkFileDialog
import socket
import sys
class Connector:
def __init__(self):
self.connected = False
def connect(self,host,port):
if not self.connected:
try:
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... | true | true |
f7581e6700f4c1a7343043e32689136a34260cdf | 4,178 | py | Python | configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/ochuman/res152_ochuman_256x192.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/ochuman/res152_ochuman_256x192.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/ochuman/res152_ochuman_256x192.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ochuman.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... | 29.631206 | 79 | 0.631642 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ochuman.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
lr_config = dict(
policy='step',
warmup='linear',
wa... | true | true |
f7581eb2605e1ecc9b9e375771a3f8def4533ca5 | 986 | py | Python | fdrtd/handle.py | UNakade/server | f659524242d01fe67f9801ab41fabf46640ad590 | [
"MIT"
] | null | null | null | fdrtd/handle.py | UNakade/server | f659524242d01fe67f9801ab41fabf46640ad590 | [
"MIT"
] | null | null | null | fdrtd/handle.py | UNakade/server | f659524242d01fe67f9801ab41fabf46640ad590 | [
"MIT"
] | null | null | null | class Handle(dict):
def __init__(self, api, handle, callback):
# derive from dict so instances get auto serialized to JSON when passed as a parameter to an API call
super().__init__(handle=handle, callback=callback)
# however, api is a client-side instance and should not get serialized, s... | 44.818182 | 109 | 0.547667 | class Handle(dict):
def __init__(self, api, handle, callback):
super().__init__(handle=handle, callback=callback)
self.api = api
def __getattr__(self, attr):
if attr in self.__dict__:
return super().__getattr__(attr)
... | true | true |
f7581eb7df7f5228cd668dd1ea3531a824de33c8 | 24,737 | py | Python | geopandas/tests/test_geom_methods.py | ngohaily/geopandas | 2725f346e430edb6a5164c21dd707de328329f31 | [
"BSD-3-Clause"
] | null | null | null | geopandas/tests/test_geom_methods.py | ngohaily/geopandas | 2725f346e430edb6a5164c21dd707de328329f31 | [
"BSD-3-Clause"
] | null | null | null | geopandas/tests/test_geom_methods.py | ngohaily/geopandas | 2725f346e430edb6a5164c21dd707de328329f31 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import string
import numpy as np
from pandas import Series, DataFrame, MultiIndex
from shapely.geometry import (
Point, LinearRing, LineString, Polygon, MultiPoint)
from shapely.geometry.collection import GeometryCollection
from shapely.ops import unary_union
from geopandas... | 39.390127 | 79 | 0.585964 | from __future__ import absolute_import
import string
import numpy as np
from pandas import Series, DataFrame, MultiIndex
from shapely.geometry import (
Point, LinearRing, LineString, Polygon, MultiPoint)
from shapely.geometry.collection import GeometryCollection
from shapely.ops import unary_union
from geopandas... | true | true |
f7582034686c4b6c71a489b1ad89f5f66882dd4b | 9,023 | py | Python | src/config/schema-transformer/test/test_route_table.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | null | null | null | src/config/schema-transformer/test/test_route_table.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | 2 | 2018-12-04T02:20:52.000Z | 2018-12-22T06:16:30.000Z | src/config/schema-transformer/test/test_route_table.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | 1 | 2018-12-04T02:07:47.000Z | 2018-12-04T02:07:47.000Z | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import gevent
try:
import to_bgp
except ImportError:
from schema_transformer import to_bgp
from vnc_api.vnc_api import (RouteTargetList, RouteTable, RouteTableType,
VirtualNetwork, VirtualMachineInterface, NetworkIpam, VnSubnetsType,... | 38.07173 | 93 | 0.624183 |
import gevent
try:
import to_bgp
except ImportError:
from schema_transformer import to_bgp
from vnc_api.vnc_api import (RouteTargetList, RouteTable, RouteTableType,
VirtualNetwork, VirtualMachineInterface, NetworkIpam, VnSubnetsType, IpamSubnetType,
LogicalRouter, SubnetType, RouteType, Com... | true | true |
f7582093ca3801b029c3766207d2b8ce25dc8d9e | 1,590 | py | Python | bbutil/__init__.py | TheUncleKai/bbutils | 62a1258849c284de5e33fe85fb10a50e5b9f034e | [
"Apache-2.0"
] | null | null | null | bbutil/__init__.py | TheUncleKai/bbutils | 62a1258849c284de5e33fe85fb10a50e5b9f034e | [
"Apache-2.0"
] | 9 | 2020-01-11T23:23:39.000Z | 2021-12-10T15:08:30.000Z | bbutil/__init__.py | TheUncleKai/bbutils | 62a1258849c284de5e33fe85fb10a50e5b9f034e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# 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 ... | 23.043478 | 99 | 0.703774 |
__all__ = [
"logging",
"lang",
"data",
"utils"
]
__name__ = "bbutils"
__author__ = "Kai Raphahn"
__email__ = "kai.raphahn@laburec.de"
__year__ = 2020
__copyright__ = "Copyright (C) {0:d}, {1:s} <{2:s}>".format(__year__, __author__, __email__)
__description__ = "Small coll... | true | true |
f7582232e4939500cc9dda6160bc230ad3cd207f | 20,190 | py | Python | xbee/backend/base.py | PowerFlex/python-xbee-intercept | 0c07f3a5f16f479ad7c925cd31638598030cf5a7 | [
"MIT"
] | null | null | null | xbee/backend/base.py | PowerFlex/python-xbee-intercept | 0c07f3a5f16f479ad7c925cd31638598030cf5a7 | [
"MIT"
] | null | null | null | xbee/backend/base.py | PowerFlex/python-xbee-intercept | 0c07f3a5f16f479ad7c925cd31638598030cf5a7 | [
"MIT"
] | null | null | null | """
base.py
By Paul Malmsten, 2010
Inspired by code written by Amit Synderman and Marco Sangalli
pmalmsten@gmail.com
XBee superclass module
This class defines data and methods common to all XBee modules.
This class should be subclassed in order to provide
series-specific functionality.
"""
from xbee.frame import API... | 39.433594 | 81 | 0.520505 | from xbee.frame import APIFrame
from xbee.python2to3 import byteToInt, stringToBytes
class CommandFrameException(KeyError):
pass
class XBeeBase(object):
def __init__(self, ser, shorthand=True, callback=None,
escaped=False, error_callback=None):
self.serial = ser
self.shorth... | true | true |
f758228473fea79024639644c2e98a41e67b5bb2 | 3,306 | py | Python | funfact/legacy/rbf/_base.py | terryjx/FunFact | 595c3b68bac7cc92c802969f207f060c1242a88b | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-12-13T07:55:16.000Z | 2021-12-13T07:55:16.000Z | funfact/legacy/rbf/_base.py | terryjx/FunFact | 595c3b68bac7cc92c802969f207f060c1242a88b | [
"BSD-3-Clause-LBNL"
] | null | null | null | funfact/legacy/rbf/_base.py | terryjx/FunFact | 595c3b68bac7cc92c802969f207f060c1242a88b | [
"BSD-3-Clause-LBNL"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import namedtuple
import dill
import numpy as np
import pycuda.driver as cuda
from funfact.cuda import context_manager, ManagedArray
class RBFExpansionBasePyCUDA:
def __init__(self):
context_manager.autoinit()
@staticmethod
def as_na... | 28.25641 | 80 | 0.54386 |
from collections import namedtuple
import dill
import numpy as np
import pycuda.driver as cuda
from funfact.cuda import context_manager, ManagedArray
class RBFExpansionBasePyCUDA:
def __init__(self):
context_manager.autoinit()
@staticmethod
def as_namedtuple(name, **kwargs):
return nam... | true | true |
f75822b965b71024cf9925ed8c3b693ec4c8e7dc | 994 | py | Python | shamrock/types/mempool_item.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | 3 | 2022-02-10T09:46:23.000Z | 2022-03-22T17:10:50.000Z | shamrock/types/mempool_item.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | shamrock/types/mempool_item.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import List
from shamrock.consensus.cost_calculator import NPCResult
from shamrock.types.blockchain_format.coin import Coin
from shamrock.types.blockchain_format.program import SerializedProgram
from shamrock.types.blockchain_format.sized_bytes import bytes32
from shamrock... | 28.4 | 70 | 0.77163 | from dataclasses import dataclass
from typing import List
from shamrock.consensus.cost_calculator import NPCResult
from shamrock.types.blockchain_format.coin import Coin
from shamrock.types.blockchain_format.program import SerializedProgram
from shamrock.types.blockchain_format.sized_bytes import bytes32
from shamrock... | true | true |
f75822d3ca52fb284810c4c74466a25b0732a6a4 | 2,649 | py | Python | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydicom-0.9.8-py2.7.egg/dicom/test/test_multival.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 20 | 2016-02-02T10:31:41.000Z | 2021-11-08T08:35:25.000Z | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydicom-0.9.8-py2.7.egg/dicom/test/test_multival.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 7 | 2016-10-21T04:15:22.000Z | 2020-02-15T04:06:19.000Z | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydicom-0.9.8-py2.7.egg/dicom/test/test_multival.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 9 | 2018-01-24T21:46:10.000Z | 2022-03-08T09:42:42.000Z | # test_multival.py
"""Test suite for MultiValue class"""
# Copyright (c) 2012 Darcy Mason
# This file is part of pydicom, relased under an MIT-style license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import unittest
from dicom.multival import Mu... | 40.753846 | 136 | 0.653832 |
import unittest
from dicom.multival import MultiValue
from dicom.valuerep import DS, DSfloat, DSdecimal, IS
import dicom.config
import sys
python_version = sys.version_info
class MultiValuetests(unittest.TestCase):
def testMultiDS(self):
multival = MultiValue(DS, ['11.1', '22.2', '33.3'])
f... | true | true |
f75823411ab9c6a8b01e8c136a3bc04017872768 | 3,385 | py | Python | HW/2/script/download.py | houzeyu2683/IRRHW | c44298ad14c468eff36bc75ebc63abdc9ba24d55 | [
"Apache-2.0"
] | null | null | null | HW/2/script/download.py | houzeyu2683/IRRHW | c44298ad14c468eff36bc75ebc63abdc9ba24d55 | [
"Apache-2.0"
] | null | null | null | HW/2/script/download.py | houzeyu2683/IRRHW | c44298ad14c468eff36bc75ebc63abdc9ba24d55 | [
"Apache-2.0"
] | 1 | 2022-01-16T03:40:34.000Z | 2022-01-16T03:40:34.000Z |
##
## The packages.
from selenium import webdriver
import pandas, os, tqdm, time
##
## The arguments.
# keyword = ["Covid-19", "Stroke", "Myocardial Infarction", "influenza", "asthma", "chest cavity"]
keyword = ["chest cavity"]
for k in keyword:
platform = "pubmed"
site = "https://pubmed.ncbi.nlm.nih.... | 21.83871 | 117 | 0.512851 |
mport webdriver
import pandas, os, tqdm, time
st cavity"]
for k in keyword:
platform = "pubmed"
site = "https://pubmed.ncbi.nlm.nih.gov/"
number = 100
folder = "resource/csv/{}".format(k)
os.makedirs(folder) if not os.path.isdir(folder) else None
option = webdriver.chrome.option... | true | true |
f75823cb0417aa7ef243589110dc60789a16927f | 3,669 | py | Python | pvrcnn/inference.py | eraofelix/PV-RCNN | 6361ec99cc1c92120263ef56b2c2b003c2cd7264 | [
"MIT"
] | 1 | 2020-03-01T19:47:14.000Z | 2020-03-01T19:47:14.000Z | pvrcnn/inference.py | eraofelix/PV-RCNN | 6361ec99cc1c92120263ef56b2c2b003c2cd7264 | [
"MIT"
] | null | null | null | pvrcnn/inference.py | eraofelix/PV-RCNN | 6361ec99cc1c92120263ef56b2c2b003c2cd7264 | [
"MIT"
] | null | null | null | import copy
import os
import os.path as osp
import numpy as np
import torch
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
from tqdm import tqdm
import time
from pvrcnn.core import cfg, Preprocessor
from pvrcnn.detect... | 36.326733 | 92 | 0.669392 | import copy
import os
import os.path as osp
import numpy as np
import torch
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
from tqdm import tqdm
import time
from pvrcnn.core import cfg, Preprocessor
from pvrcnn.detect... | true | true |
f758243fa477c542c1218633114993f0c127f9a8 | 6,130 | py | Python | rip.py | jiomvk/dash-widevine-rip | aec41bca7f7c7f4568d2134490584c05e30603ca | [
"MIT"
] | 1 | 2021-12-24T22:20:00.000Z | 2021-12-24T22:20:00.000Z | rip.py | jiomvk/dash-widevine-rip | aec41bca7f7c7f4568d2134490584c05e30603ca | [
"MIT"
] | null | null | null | rip.py | jiomvk/dash-widevine-rip | aec41bca7f7c7f4568d2134490584c05e30603ca | [
"MIT"
] | null | null | null | """
Given a TOML playlist configuration, rips a Widevine DRM-encrypted DASH stream by parsing
the MPD configuration, decrypting audio and video parts individually, then
combining them into a single video file.
"""
import os
import sys
from enum import Enum
from typing import Dict, List, Optional, Union
import requests... | 31.761658 | 89 | 0.640457 | import os
import sys
from enum import Enum
from typing import Dict, List, Optional, Union
import requests
import toml
import xmltodict
import ffmpeg
from pydantic import BaseModel, Field
class ContentType(str, Enum):
video = "video"
audio = "audio"
class Source(BaseModel):
base: str = Field(...)
mp... | true | true |
f75824648fb036d40497b5b70bc5deb62bff905c | 1,713 | py | Python | audio/python/synthesize_stream.py | oleges1/tinkoff_bot | fba35d03c3bd8b39caf7b1af978874ec27f7f27f | [
"MIT"
] | null | null | null | audio/python/synthesize_stream.py | oleges1/tinkoff_bot | fba35d03c3bd8b39caf7b1af978874ec27f7f27f | [
"MIT"
] | null | null | null | audio/python/synthesize_stream.py | oleges1/tinkoff_bot | fba35d03c3bd8b39caf7b1af978874ec27f7f27f | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
from tinkoff.cloud.tts.v1 import tts_pb2_grpc, tts_pb2
from auth import authorization_metadata
from audio import audio_open_write
from common import (
BaseSynthesisParser,
make_channel,
build_synthesis_request,
)
def synthesize():
args = BaseSynthesisParser().parse_args()
if... | 40.785714 | 93 | 0.7338 |
from tinkoff.cloud.tts.v1 import tts_pb2_grpc, tts_pb2
from auth import authorization_metadata
from audio import audio_open_write
from common import (
BaseSynthesisParser,
make_channel,
build_synthesis_request,
)
def synthesize():
args = BaseSynthesisParser().parse_args()
if args.encoding == tts_p... | true | true |
f7582465af717ebc8cb4ef2e50cb43a5d0f86912 | 1,109 | py | Python | terraform/nginx/shared/tls-function/tls.py | cicdenv/cicdenv | 5b72fd9ef000bf07c2052471b59edaa91af18778 | [
"MIT"
] | 8 | 2020-08-10T20:57:24.000Z | 2021-08-08T10:46:20.000Z | terraform/nginx/shared/tls-function/tls.py | cicdenv/cicdenv | 5b72fd9ef000bf07c2052471b59edaa91af18778 | [
"MIT"
] | null | null | null | terraform/nginx/shared/tls-function/tls.py | cicdenv/cicdenv | 5b72fd9ef000bf07c2052471b59edaa91af18778 | [
"MIT"
] | 1 | 2020-08-10T20:42:09.000Z | 2020-08-10T20:42:09.000Z | from sys import stdout, stderr
from subprocess import check_call
from os import path, remove
from base64 import b64encode
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat, PrivateFormat, NoEncryption
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.back... | 29.184211 | 132 | 0.770965 | from sys import stdout, stderr
from subprocess import check_call
from os import path, remove
from base64 import b64encode
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat, PrivateFormat, NoEncryption
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.back... | true | true |
f75824f31839707f9c3d79c319dd78554532922e | 2,424 | py | Python | sark/encodings/hex_bytes.py | yannayl/Sark | 30abd3fbba67389c9b1a30ede724e2fd96c7534f | [
"MIT"
] | 5 | 2016-05-27T01:47:00.000Z | 2022-03-05T02:29:27.000Z | sark/encodings/hex_bytes.py | shemesh999/Sark | 421f22124006567d79443135046519f0487c7261 | [
"MIT"
] | null | null | null | sark/encodings/hex_bytes.py | shemesh999/Sark | 421f22124006567d79443135046519f0487c7261 | [
"MIT"
] | 2 | 2016-05-27T08:57:43.000Z | 2022-03-05T02:29:34.000Z | """ Python 'hex_bytes' Codec - 2-digit hex codec with spaces between bytes.
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
"""
import codecs, binascii
from string import hexdigits
### Codec APIs
def hex_encode(input, errors='stri... | 28.857143 | 83 | 0.686056 | import codecs, binascii
from string import hexdigits
rrors='strict'):
assert errors == 'strict'
temp = binascii.b2a_hex(input)
output = " ".join(temp[i:i + 2] for i in xrange(0, len(temp), 2))
return (output, len(input))
def hex_decode(input, errors='strict'):
assert errors == 'strict'
output... | true | true |
f75825331bc88387482825963835c59f21daa975 | 423 | py | Python | Mundo 1/ex006.py | judigunkel/judi-exercicios-python | c61bb75b1ae6141defcf42214194e141a70af15d | [
"MIT"
] | null | null | null | Mundo 1/ex006.py | judigunkel/judi-exercicios-python | c61bb75b1ae6141defcf42214194e141a70af15d | [
"MIT"
] | null | null | null | Mundo 1/ex006.py | judigunkel/judi-exercicios-python | c61bb75b1ae6141defcf42214194e141a70af15d | [
"MIT"
] | 1 | 2021-03-06T02:41:36.000Z | 2021-03-06T02:41:36.000Z | """
Crie um algoritmo que leia um número e mostre seu dobro, triplo e raíz quadrada
"""
# importando a função sqrt (raíz quadrada) da biblioteca math
from math import sqrt
n = int(input('Digite um número inteiro: '))
print(f'O dobro de \033[35m{n}\033[m é \033[31m{n * 2}\033[m')
print(f'O triplo de \033[35m{n}\033[m ... | 35.25 | 79 | 0.680851 |
from math import sqrt
n = int(input('Digite um número inteiro: '))
print(f'O dobro de \033[35m{n}\033[m é \033[31m{n * 2}\033[m')
print(f'O triplo de \033[35m{n}\033[m é \033[33m{n * 3}\033[m')
print(f'A raíz quadrada de \033[35m{n}\033[m é \033[34m{sqrt(n):.1f}\033[m')
| true | true |
f75825b9304a0a543ba934ea188b28635efe4a85 | 1,499 | py | Python | bfxhfindicators/mass_index.py | Harsh-Sanklecha/stockanalysis | f5c6a454863ff72e0bac5e29035033cbf1bb3a06 | [
"MIT"
] | 29 | 2018-10-30T11:01:17.000Z | 2021-11-27T10:51:35.000Z | bfxhfindicators/mass_index.py | Harsh-Sanklecha/stockanalysis | f5c6a454863ff72e0bac5e29035033cbf1bb3a06 | [
"MIT"
] | 7 | 2018-11-08T09:09:50.000Z | 2020-11-21T09:14:41.000Z | bfxhfindicators/mass_index.py | bitfinexcom/bfx-hf-indicators-py | de707031bb6a8d23dc70be34220e9a95d4d4d861 | [
"Apache-2.0"
] | 18 | 2018-10-27T16:53:47.000Z | 2021-10-17T15:47:24.000Z | from bfxhfindicators.indicator import Indicator
from bfxhfindicators.ema import EMA
class MassIndex(Indicator):
def __init__(self, period, cache_size=None):
self._smoothing = period
self._singleEMA = EMA(9, cache_size)
self._doubleEMA = EMA(9, cache_size)
self._buffer = []
super().__init__({
... | 25.844828 | 68 | 0.625751 | from bfxhfindicators.indicator import Indicator
from bfxhfindicators.ema import EMA
class MassIndex(Indicator):
def __init__(self, period, cache_size=None):
self._smoothing = period
self._singleEMA = EMA(9, cache_size)
self._doubleEMA = EMA(9, cache_size)
self._buffer = []
super().__init__({
... | true | true |
f7582650e8d0a44057cb836222689255ed8775cc | 2,308 | py | Python | primeiros_models/dense_features.py | luizapozzobon/myo_project | ce35149c444dee5a13dc7d1f1915046066ba47e2 | [
"MIT"
] | 1 | 2019-05-02T16:38:12.000Z | 2019-05-02T16:38:12.000Z | primeiros_models/dense_features.py | luizapozzobon/myo_project | ce35149c444dee5a13dc7d1f1915046066ba47e2 | [
"MIT"
] | null | null | null | primeiros_models/dense_features.py | luizapozzobon/myo_project | ce35149c444dee5a13dc7d1f1915046066ba47e2 | [
"MIT"
] | null | null | null | from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
def load_compilado(arquivo):
path = '/home/luiza/UFSM/Myo/myo_project/datasets/oficial/' + arquivo
df = pd.read_csv(path)
return df
df = load_compilado('featu... | 29.974026 | 111 | 0.741768 | from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
def load_compilado(arquivo):
path = '/home/luiza/UFSM/Myo/myo_project/datasets/oficial/' + arquivo
df = pd.read_csv(path)
return df
df = load_compilado('featu... | true | true |
f758273d3758ecb02b358bbae4f0b9bc06cbd770 | 3,554 | py | Python | accounting/accounting/doctype/sales_invoice/test_sales_invoice.py | noahjacob/Accounting | 6be90c4f82867156532ca71b1faa9d017e3269af | [
"MIT"
] | 1 | 2021-04-05T06:22:16.000Z | 2021-04-05T06:22:16.000Z | accounting/accounting/doctype/sales_invoice/test_sales_invoice.py | mohsinalimat/Accounting | 6be90c4f82867156532ca71b1faa9d017e3269af | [
"MIT"
] | null | null | null | accounting/accounting/doctype/sales_invoice/test_sales_invoice.py | mohsinalimat/Accounting | 6be90c4f82867156532ca71b1faa9d017e3269af | [
"MIT"
] | 2 | 2021-04-05T06:22:17.000Z | 2021-04-10T06:05:36.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Noah Jacob and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, nowdate
import unittest
class TestSalesInvoice(unittest.TestCase):
def test_new_sales_invoice_totals(self):
si = create_sales_invoice('Noah... | 25.385714 | 155 | 0.703151 |
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, nowdate
import unittest
class TestSalesInvoice(unittest.TestCase):
def test_new_sales_invoice_totals(self):
si = create_sales_invoice('Noah','Nintendo Switch',1,30000,True,False)
si.append('items',
{
"item_name":'Nintend... | true | true |
f758283893c27936782ec080a5461b712f9a4509 | 882 | py | Python | blog/urls.py | Jafte/jasn.ru | 09d2945825c5bbfa2896c4acfc30acb6138c9ac9 | [
"MIT"
] | null | null | null | blog/urls.py | Jafte/jasn.ru | 09d2945825c5bbfa2896c4acfc30acb6138c9ac9 | [
"MIT"
] | 4 | 2021-06-04T21:30:01.000Z | 2021-09-22T17:39:12.000Z | blog/urls.py | Jafte/jasn.ru | 09d2945825c5bbfa2896c4acfc30acb6138c9ac9 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from blog.views import BlogDetail, BlogPostDetail, BlogList, BlogUpdate, BlogCreate, BlogPostCreate, BlogPostUpdate, \
BlogPostImageCreate
urlpatterns = [
url(r'^$', BlogList.as_view(), name='blog-list'),
url(r'^add/$', BlogCreate.as_view(), name='blog-create'),
url(r'^... | 58.8 | 118 | 0.650794 | from django.conf.urls import url
from blog.views import BlogDetail, BlogPostDetail, BlogList, BlogUpdate, BlogCreate, BlogPostCreate, BlogPostUpdate, \
BlogPostImageCreate
urlpatterns = [
url(r'^$', BlogList.as_view(), name='blog-list'),
url(r'^add/$', BlogCreate.as_view(), name='blog-create'),
url(r'^... | true | true |
f7582d34708e51508312861c53b1a870d70ffa66 | 3,660 | py | Python | transformers/depmap/python-flask-server/openapi_server/controllers/depmap_transformer.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 5 | 2020-08-28T09:30:16.000Z | 2021-12-29T16:00:26.000Z | transformers/depmap/python-flask-server/openapi_server/controllers/depmap_transformer.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 19 | 2021-04-26T22:19:16.000Z | 2022-03-09T21:09:55.000Z | transformers/depmap/python-flask-server/openapi_server/controllers/depmap_transformer.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 8 | 2020-07-09T18:50:57.000Z | 2022-01-20T16:01:33.000Z | import collections
import sqlite3
from collections import defaultdict
from transformers.transformer import Transformer
from openapi_server.models.names import Names
from openapi_server.models.attribute import Attribute
from openapi_server.models.element import Element
from openapi_server.models.connection import Conn... | 42.068966 | 120 | 0.636339 | import collections
import sqlite3
from collections import defaultdict
from transformers.transformer import Transformer
from openapi_server.models.names import Names
from openapi_server.models.attribute import Attribute
from openapi_server.models.element import Element
from openapi_server.models.connection import Conn... | true | true |
f7582dcac663a465c6947a841857e841013d60e6 | 856 | py | Python | spug_api/apps/apis/utils.py | showsmall/spug | 9c878d37c3bd732808d43a2a3958735a9ad07cfe | [
"MIT"
] | 2 | 2020-08-10T14:29:46.000Z | 2021-05-21T09:06:20.000Z | spug_api/apps/apis/utils.py | xiaoyiios/spug | 67c137da9ea1bc451bfa1c34ebfb35c4821825c2 | [
"MIT"
] | null | null | null | spug_api/apps/apis/utils.py | xiaoyiios/spug | 67c137da9ea1bc451bfa1c34ebfb35c4821825c2 | [
"MIT"
] | 1 | 2020-09-07T03:48:44.000Z | 2020-09-07T03:48:44.000Z | from collections import defaultdict
from apps.configuration.models import Environment
class MapConfigValues(object):
def __init__(self, values, env_id):
environments = Environment.query.all()
sort_environments = sorted([x for x in environments if x.id != env_id], key=lambda x: x.priority)
... | 34.24 | 105 | 0.654206 | from collections import defaultdict
from apps.configuration.models import Environment
class MapConfigValues(object):
def __init__(self, values, env_id):
environments = Environment.query.all()
sort_environments = sorted([x for x in environments if x.id != env_id], key=lambda x: x.priority)
... | true | true |
f7582dd63ad830b63f900923a3a740c745d95833 | 3,197 | py | Python | VAE/vae.py | alexborio/Projects | a85ad4aab370b009de14e3696e06aad92ca4859f | [
"MIT"
] | null | null | null | VAE/vae.py | alexborio/Projects | a85ad4aab370b009de14e3696e06aad92ca4859f | [
"MIT"
] | null | null | null | VAE/vae.py | alexborio/Projects | a85ad4aab370b009de14e3696e06aad92ca4859f | [
"MIT"
] | null | null | null |
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
encoder_layers = []
decoder_layers = []
Normal = tf.contrib.distributions.Normal
Bernoulli = tf.contrib.distributions.Bernoulli
class Layer(object):
def __init__(self, n, m, f=tf... | 24.782946 | 93 | 0.650297 |
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
encoder_layers = []
decoder_layers = []
Normal = tf.contrib.distributions.Normal
Bernoulli = tf.contrib.distributions.Bernoulli
class Layer(object):
def __init__(self, n, m, f=tf... | true | true |
f7583015bcdece55da2bde58328180a753742c9f | 631 | py | Python | backend/manage.py | crowdbotics-apps/arkde-31785 | d4f4189b8c7a4f0b94763b651cbd6b5ba23304a3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/arkde-31785 | d4f4189b8c7a4f0b94763b651cbd6b5ba23304a3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/arkde-31785 | d4f4189b8c7a4f0b94763b651cbd6b5ba23304a3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arkde_31785.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... | 28.681818 | 75 | 0.684628 |
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arkde_31785.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f75830beecd393eba8f152294cb9f5a7ec1f2583 | 1,314 | py | Python | torch_geometric/transforms/one_hot_degree.py | itamblyn/pytorch_geometric | 67ed16492863378b8434b03713a75924f0cc5df1 | [
"MIT"
] | 2 | 2020-08-06T16:14:15.000Z | 2021-11-08T07:33:21.000Z | torch_geometric/transforms/one_hot_degree.py | ChenShengsGitHub/pytorch_geometric | 86308313d6f1af56e5931e2ca89bb1a867c10ff3 | [
"MIT"
] | 1 | 2021-06-05T10:32:22.000Z | 2021-06-05T10:32:22.000Z | torch_geometric/transforms/one_hot_degree.py | ChenShengsGitHub/pytorch_geometric | 86308313d6f1af56e5931e2ca89bb1a867c10ff3 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from torch_geometric.utils import degree
from torch_geometric.transforms import BaseTransform
class OneHotDegree(BaseTransform):
r"""Adds the node degree as one hot encodings to the node features.
Args:
max_degree (int): Maximum degree.
in_degree ... | 33.692308 | 77 | 0.627093 | import torch
import torch.nn.functional as F
from torch_geometric.utils import degree
from torch_geometric.transforms import BaseTransform
class OneHotDegree(BaseTransform):
def __init__(self, max_degree, in_degree=False, cat=True):
self.max_degree = max_degree
self.in_degree = in_degree
... | true | true |
f75830e863cb5c6f441abbd75d0faad66b975aa1 | 324 | py | Python | ffmpeg_db/ffmpeg_db.py | audo-ai/ffmpeg-db | 1f82aaf366950a9d5f9b086503ce1976a47456c4 | [
"MIT"
] | null | null | null | ffmpeg_db/ffmpeg_db.py | audo-ai/ffmpeg-db | 1f82aaf366950a9d5f9b086503ce1976a47456c4 | [
"MIT"
] | null | null | null | ffmpeg_db/ffmpeg_db.py | audo-ai/ffmpeg-db | 1f82aaf366950a9d5f9b086503ce1976a47456c4 | [
"MIT"
] | null | null | null | import json
from pkg_resources import resource_filename
def load_resource(name):
with open(resource_filename('ffmpeg_db', name)) as f:
return json.load(f)
def ext_to_codecs_json():
return load_resource('data/ext-to-codecs.json')
def codec_info_json():
return load_resource('data/codec-info.jso... | 19.058824 | 57 | 0.737654 | import json
from pkg_resources import resource_filename
def load_resource(name):
with open(resource_filename('ffmpeg_db', name)) as f:
return json.load(f)
def ext_to_codecs_json():
return load_resource('data/ext-to-codecs.json')
def codec_info_json():
return load_resource('data/codec-info.jso... | true | true |
f758314622fafbd4c3126bb8b4f787fee1ba65a8 | 1,318 | py | Python | examples/python/unit-test-simple/bugzilla_test.py | AlaminMahamud/Test-Driven-Development---Notes | 5acf9e15858a6af6209ead5c0f13ddb903a3277a | [
"MIT"
] | null | null | null | examples/python/unit-test-simple/bugzilla_test.py | AlaminMahamud/Test-Driven-Development---Notes | 5acf9e15858a6af6209ead5c0f13ddb903a3277a | [
"MIT"
] | null | null | null | examples/python/unit-test-simple/bugzilla_test.py | AlaminMahamud/Test-Driven-Development---Notes | 5acf9e15858a6af6209ead5c0f13ddb903a3277a | [
"MIT"
] | null | null | null | from .bugzilla import MyBugzilla
import unittest
import requests_mock
from unittest import mock
import requests
class TestBugZilla(unittest.TestCase):
def test_bug_id(self):
zilla = MyBugzilla(
'tarek@mozilla.com',
server='http://example.com'
)
link = zilla.bug_link... | 31.380952 | 90 | 0.621396 | from .bugzilla import MyBugzilla
import unittest
import requests_mock
from unittest import mock
import requests
class TestBugZilla(unittest.TestCase):
def test_bug_id(self):
zilla = MyBugzilla(
'tarek@mozilla.com',
server='http://example.com'
)
link = zilla.bug_link... | true | true |
f75832cee606f4cd93e46fc18235c4a9a42ebba2 | 5,295 | py | Python | src/quinductor/__init__.py | dkalpakchi/quinductor | 8cb78f8130636e7f4532673fb396b4d153b6a7d3 | [
"MIT"
] | null | null | null | src/quinductor/__init__.py | dkalpakchi/quinductor | 8cb78f8130636e7f4532673fb396b4d153b6a7d3 | [
"MIT"
] | null | null | null | src/quinductor/__init__.py | dkalpakchi/quinductor | 8cb78f8130636e7f4532673fb396b4d153b6a7d3 | [
"MIT"
] | null | null | null | """
Common utilities for Stanza resources.
"""
import os
import glob
import requests
from pathlib import Path
import json
import hashlib
import zipfile
import shutil
import dill
from tqdm.auto import tqdm
from .common import (
DEFAULT_TEMPLATES_DIR, QUINDUCTOR_RESOURCES_GITHUB, MODELS,
get_logger, get_defaul... | 34.383117 | 112 | 0.646648 |
import os
import glob
import requests
from pathlib import Path
import json
import hashlib
import zipfile
import shutil
import dill
from tqdm.auto import tqdm
from .common import (
DEFAULT_TEMPLATES_DIR, QUINDUCTOR_RESOURCES_GITHUB, MODELS,
get_logger, get_default_model_path, load_pos_ngrams
)
from .guards im... | true | true |
f758333f786c7ad853aad380dcbda7990b36db84 | 70 | py | Python | extensions.py | KhajaPythonMicroservices/Catalog | 3e6b16698032ced829a69c8d484bcf8e52c9de8b | [
"Apache-2.0"
] | null | null | null | extensions.py | KhajaPythonMicroservices/Catalog | 3e6b16698032ced829a69c8d484bcf8e52c9de8b | [
"Apache-2.0"
] | null | null | null | extensions.py | KhajaPythonMicroservices/Catalog | 3e6b16698032ced829a69c8d484bcf8e52c9de8b | [
"Apache-2.0"
] | 1 | 2022-03-09T10:44:12.000Z | 2022-03-09T10:44:12.000Z | from flask_sqlalchemy import SQLAlchemy
db: SQLAlchemy = SQLAlchemy() | 23.333333 | 39 | 0.828571 | from flask_sqlalchemy import SQLAlchemy
db: SQLAlchemy = SQLAlchemy() | true | true |
f75833484ec80be96b4b893f5e39b86d93445fc0 | 6,575 | py | Python | graphsense/model/taxonomy.py | graphsense/graphsense-python | c0dafc97a04bc3dbf0caf08a981bb591bd1e430a | [
"MIT"
] | 9 | 2020-11-26T12:26:36.000Z | 2022-02-07T22:08:16.000Z | graphsense/model/taxonomy.py | graphsense/graphsense-python | c0dafc97a04bc3dbf0caf08a981bb591bd1e430a | [
"MIT"
] | 14 | 2020-11-17T13:28:08.000Z | 2022-01-24T09:21:43.000Z | graphsense/model/taxonomy.py | graphsense/graphsense-python | c0dafc97a04bc3dbf0caf08a981bb591bd1e430a | [
"MIT"
] | 3 | 2022-02-03T09:24:27.000Z | 2022-02-16T10:13:55.000Z | """
GraphSense API
GraphSense API # noqa: E501
The version of the OpenAPI document: 0.5
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from graphsense.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
Mod... | 37.787356 | 110 | 0.575817 |
import re
import sys
from graphsense.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
class... | true | true |
f7583452a80cdbdc8e4eefc58e308f48fab0ef29 | 74,411 | py | Python | convert_smileys_python_2.py | deojosh17/Whatsapp-Xtract | 03e8d5868ed080f783c5ed1c0e9bb7bf25024252 | [
"MIT"
] | 47 | 2016-05-23T17:36:22.000Z | 2021-12-10T14:05:31.000Z | convert_smileys_python_2.py | kbaseio/Whatsapp-Xtract | 03e8d5868ed080f783c5ed1c0e9bb7bf25024252 | [
"MIT"
] | 5 | 2015-06-16T07:57:20.000Z | 2021-02-09T00:31:46.000Z | convert_smileys_python_2.py | kbaseio/Whatsapp-Xtract | 03e8d5868ed080f783c5ed1c0e9bb7bf25024252 | [
"MIT"
] | 13 | 2017-05-21T13:25:23.000Z | 2021-06-22T16:50:41.000Z | def convertsmileys_python2 (text):
newtext = str(text)
# new emojis
newtext = newtext.replace(u'\U0001F0CF', '<img src="data/emoji_new/1F0CF.png" alt=""/>')
newtext = newtext.replace(u'\U0001F191', '<img src="data/emoji_new/1F191.png" alt=""/>')
newtext = newtext.replace(u'\U0001F193', '<img sr... | 80.706074 | 92 | 0.63453 | def convertsmileys_python2 (text):
newtext = str(text)
newtext = newtext.replace(u'\U0001F0CF', '<img src="data/emoji_new/1F0CF.png" alt=""/>')
newtext = newtext.replace(u'\U0001F191', '<img src="data/emoji_new/1F191.png" alt=""/>')
newtext = newtext.replace(u'\U0001F193', '<img src="data/emoj... | true | true |
f758355ad052c97d8ad8db05b91b6d3c111a72fd | 5,441 | py | Python | flsim/optimizers/tests/test_optimizer_factories.py | JohnlNguyen/FLSim | a5ed7c0b84499cd9dbc5fe95f8bcb4ba8ab5a5cb | [
"BSD-3-Clause"
] | 79 | 2021-12-09T18:05:09.000Z | 2022-03-23T20:43:46.000Z | flsim/optimizers/tests/test_optimizer_factories.py | JohnlNguyen/FLSim | a5ed7c0b84499cd9dbc5fe95f8bcb4ba8ab5a5cb | [
"BSD-3-Clause"
] | 11 | 2021-12-30T17:54:04.000Z | 2022-03-23T17:23:00.000Z | flsim/optimizers/tests/test_optimizer_factories.py | JohnlNguyen/FLSim | a5ed7c0b84499cd9dbc5fe95f8bcb4ba8ab5a5cb | [
"BSD-3-Clause"
] | 9 | 2021-12-09T19:55:22.000Z | 2022-03-15T00:02:08.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from flsim.common.pytest_helper import assertEqual, assertTrue
from flsim.... | 40.007353 | 88 | 0.651718 |
import pytest
from flsim.common.pytest_helper import assertEqual, assertTrue
from flsim.optimizers.async_aggregators import (
AsyncAggregatorConfig,
FedAdamAsyncAggregatorConfig,
FedAvgWithLRAsyncAggregatorConfig,
HybridAggregatorConfig,
FedAdamHybridAggregatorConfig,
FedAvgWithLRHybridAg... | true | true |
f75835679a143d21f97223c08a039ea1ec9f57a5 | 524 | py | Python | setup.py | elbow-jason/Uno | 4ad07d7b84e5b6e3e2b2c89db69448906f24b4e4 | [
"MIT"
] | null | null | null | setup.py | elbow-jason/Uno | 4ad07d7b84e5b6e3e2b2c89db69448906f24b4e4 | [
"MIT"
] | 3 | 2015-11-09T19:25:22.000Z | 2016-06-07T15:02:03.000Z | setup.py | elbow-jason/Uno | 4ad07d7b84e5b6e3e2b2c89db69448906f24b4e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
long_description = """
Extremely fast and easy feature based HTML generator.
"""
project = 'uno'
setup(
name=project,
version='0.3.3',
description=long_description,
author='Jason Goldberger',
author_email='jason@datamelon.io',
url='https:/... | 19.407407 | 53 | 0.624046 |
from setuptools import setup
long_description = """
Extremely fast and easy feature based HTML generator.
"""
project = 'uno'
setup(
name=project,
version='0.3.3',
description=long_description,
author='Jason Goldberger',
author_email='jason@datamelon.io',
url='https://github.com/jlgoldb2/Un... | true | true |
f75835bcab76179996c049644ca8bb9cf32ec97b | 13,340 | py | Python | tensorflow_probability/python/distributions/inverse_gamma.py | bhgedigital/probability | df70fe68491f839df438628fa79cb3378888039e | [
"Apache-2.0"
] | 4 | 2019-03-07T05:15:13.000Z | 2019-06-13T20:35:45.000Z | tensorflow_probability/python/distributions/inverse_gamma.py | datasailors/probability | df70fe68491f839df438628fa79cb3378888039e | [
"Apache-2.0"
] | 1 | 2019-02-28T21:28:01.000Z | 2019-02-28T21:28:01.000Z | tensorflow_probability/python/distributions/inverse_gamma.py | datasailors/probability | df70fe68491f839df438628fa79cb3378888039e | [
"Apache-2.0"
] | 1 | 2019-09-18T15:17:53.000Z | 2019-09-18T15:17:53.000Z | # Copyright 2018 The TensorFlow Probability 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 o... | 36.547945 | 92 | 0.677961 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow_probability.python.distributions import distribution
from tensorflow_probability.python.internal import distribution_util
from tensorf... | true | true |
f75836f2e16db67aba57e7cec1e066c06a78865f | 1,571 | py | Python | rooms/E11_R1.py | stfbnc/TrovaEscapeBackEnd | ca32523c14f44e65ddac475f44ed0467eb8c3552 | [
"MIT"
] | 1 | 2020-12-09T21:01:07.000Z | 2020-12-09T21:01:07.000Z | rooms/E11_R1.py | stfbnc/TrovaEscapeBackEnd | ca32523c14f44e65ddac475f44ed0467eb8c3552 | [
"MIT"
] | null | null | null | rooms/E11_R1.py | stfbnc/TrovaEscapeBackEnd | ca32523c14f44e65ddac475f44ed0467eb8c3552 | [
"MIT"
] | null | null | null | import Room
import Constants as c
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
from selenium.webdriver.firefox.options import Options
class E11_R... | 34.152174 | 118 | 0.65818 | import Room
import Constants as c
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
from selenium.webdriver.firefox.options import Options
class E11_R... | true | true |
f7583a089b5d2d57f0a5a543485bb54a604c5147 | 2,747 | py | Python | src/plot.py | brynhayder/metapop | 2a5f25a904cba7133c398c9ce7fff6ad7a5d8705 | [
"MIT"
] | null | null | null | src/plot.py | brynhayder/metapop | 2a5f25a904cba7133c398c9ce7fff6ad7a5d8705 | [
"MIT"
] | null | null | null | src/plot.py | brynhayder/metapop | 2a5f25a904cba7133c398c9ce7fff6ad7a5d8705 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
import os
import matplotlib.pyplot as plt
import pandas as pd
filenames = "susceptible.csv exposed.csv infected.csv recovered.csv".split()
def title(ax, region):
return ax.set_title(region, x=0.95, y=0.9, ha="right", va="top")
def legend(fig, ax):
lins, labs = ax.get_l... | 30.865169 | 88 | 0.577721 | from argparse import ArgumentParser
import os
import matplotlib.pyplot as plt
import pandas as pd
filenames = "susceptible.csv exposed.csv infected.csv recovered.csv".split()
def title(ax, region):
return ax.set_title(region, x=0.95, y=0.9, ha="right", va="top")
def legend(fig, ax):
lins, labs = ax.get_l... | true | true |
f7583a6da1ba5e83eaab50f4119829365135e081 | 1,105 | py | Python | source/app/processing/engine/validate_finn_code.py | seemir/stressa | 7c3b178cf13f74ee010dbd44ce99188de3862ef7 | [
"MIT"
] | null | null | null | source/app/processing/engine/validate_finn_code.py | seemir/stressa | 7c3b178cf13f74ee010dbd44ce99188de3862ef7 | [
"MIT"
] | 337 | 2019-09-27T12:26:14.000Z | 2022-03-31T04:13:04.000Z | source/app/processing/engine/validate_finn_code.py | seemir/stressa | 7c3b178cf13f74ee010dbd44ce99188de3862ef7 | [
"MIT"
] | 1 | 2019-11-08T13:40:30.000Z | 2019-11-08T13:40:30.000Z | # -*- coding: utf-8 -*-
"""
Validate Finn code validator
"""
__author__ = 'Samir Adrik'
__email__ = 'samir.adrik@gmail.com'
from source.util import Assertor, Tracking
from .operation import Operation
from ...scrapers import Finn
class ValidateFinnCode(Operation):
"""
Operation for validating a Finn code
... | 21.25 | 92 | 0.567421 |
__author__ = 'Samir Adrik'
__email__ = 'samir.adrik@gmail.com'
from source.util import Assertor, Tracking
from .operation import Operation
from ...scrapers import Finn
class ValidateFinnCode(Operation):
@Tracking
def __init__(self, finn_code: str):
self.name = self.__class__.__name__
Asse... | true | true |
f7583b24831d79bebf36a237cba7b80b44561529 | 3,000 | py | Python | strategies/tests/test_strategyType.py | pchaos/wanggeService | 839f7c6c52a685fcdc4b6a70cf8e9d6c8cc78255 | [
"MIT"
] | 11 | 2018-05-15T18:02:31.000Z | 2020-05-07T03:57:33.000Z | strategies/tests/test_strategyType.py | pchaos/wanggeService | 839f7c6c52a685fcdc4b6a70cf8e9d6c8cc78255 | [
"MIT"
] | 1 | 2018-05-16T11:27:32.000Z | 2018-07-07T10:56:58.000Z | strategies/tests/test_strategyType.py | pchaos/wanggeService | 839f7c6c52a685fcdc4b6a70cf8e9d6c8cc78255 | [
"MIT"
] | 13 | 2018-05-15T18:02:27.000Z | 2022-03-23T06:18:29.000Z | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
@File : test_strategyType.py
Description :
@Author : pchaos
date: 18-5-2
-------------------------------------------------
Change Activity:
18-5-2:
@Contact : p19992003#gmail.com
-------... | 45.454545 | 215 | 0.612667 |
from django.test import TestCase
from strategies.models import StrategyType
__author__ = 'pchaos'
class TestStrategyType(TestCase):
def test_baseStrategyType(self):
oldcount = StrategyType.objects.all().count()
code = 'test01'
name = 'testStrategyType name 01'
remark = 'test rem... | true | true |
f7583bd21c6fc0c6b654b698dfe2f9f40a7b4227 | 188 | py | Python | katas/kyu_8/the_if_function.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_8/the_if_function.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_8/the_if_function.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | def _if(bool, func, func2):
func() if bool else func2()
def truthy():
print('True')
def falsey():
print('False')
_if(True, truthy, falsey) # prints 'True' to the console
| 14.461538 | 57 | 0.617021 | def _if(bool, func, func2):
func() if bool else func2()
def truthy():
print('True')
def falsey():
print('False')
_if(True, truthy, falsey)
| true | true |
f7583c571ef1441289679d07d575677b6cf56de3 | 9,564 | py | Python | libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 388 | 2019-05-07T15:53:21.000Z | 2022-03-28T20:29:46.000Z | libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 1,286 | 2019-05-07T23:38:19.000Z | 2022-03-31T10:44:16.000Z | libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 168 | 2019-05-14T20:23:25.000Z | 2022-03-16T06:49:14.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
from typing import Dict, List, NamedTuple, Union
from aiohttp import ClientSession, ClientTimeout
from botbuilder.schema import Activity
from botbuilder.core import BotTelemetryClient, NullTelemetryClient... | 36.643678 | 114 | 0.645546 |
import json
from typing import Dict, List, NamedTuple, Union
from aiohttp import ClientSession, ClientTimeout
from botbuilder.schema import Activity
from botbuilder.core import BotTelemetryClient, NullTelemetryClient, TurnContext
from .models import FeedbackRecord, QueryResult, QueryResults
from .utils im... | true | true |
f7583c9314b2909566c73fa6897fe9d3b81c3384 | 8,398 | py | Python | leo/plugins/livecode.py | gamtiq/leo-editor | 3f51986fea4c16ed0713699b088bc8a8abd738c3 | [
"MIT"
] | 1 | 2020-11-07T23:22:12.000Z | 2020-11-07T23:22:12.000Z | leo/plugins/livecode.py | gamtiq/leo-editor | 3f51986fea4c16ed0713699b088bc8a8abd738c3 | [
"MIT"
] | null | null | null | leo/plugins/livecode.py | gamtiq/leo-editor | 3f51986fea4c16ed0713699b088bc8a8abd738c3 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:tbrown.20140806084727.30174: * @file ../plugins/livecode.py
"""
Show results of code in another pane as it's edited.
livecode-show opens the livecode pane on c.p.
Thereafter, pressing return in that body pane re-evaluates the code.
The livecode pane shows the results of each line.
"""
# By... | 34.846473 | 77 | 0.569659 |
import leo.core.leoGlobals as g
from leo.core.leoQt import QtWidgets
import ast
from collections import namedtuple
try:
from meta import asttools
except ImportError:
asttools = None
warning_given = False
def init():
global warning_given
if g.unitTesting:
return False
if not asttools... | true | true |
f7583c93b9288d5cc2c657d2da78dfae2dbfebb7 | 10,140 | py | Python | pandas/tests/io/generate_legacy_storage_files.py | dequadras/pandas | 8a7fbbeb8e3a88f8e355093eb1b68f361e65b6aa | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/io/generate_legacy_storage_files.py | dequadras/pandas | 8a7fbbeb8e3a88f8e355093eb1b68f361e65b6aa | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/io/generate_legacy_storage_files.py | dequadras/pandas | 8a7fbbeb8e3a88f8e355093eb1b68f361e65b6aa | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
self-contained to write legacy storage pickle files
To use this script. Create an environment where you want
generate pickles, say its for 0.20.3, with your pandas clone
in ~/pandas
. activate pandas_0.20.3
cd ~/
$ python pandas/pandas/tests/io/generate_legacy_storage_files.py \
panda... | 28.166667 | 87 | 0.566765 |
from datetime import timedelta
from distutils.version import LooseVersion
import os
import pickle
import platform as pl
import sys
import numpy as np
import pandas
from pandas import (
Categorical,
DataFrame,
Index,
MultiIndex,
NaT,
Period,
RangeIndex,
Series,
Timestamp,
bda... | true | true |
f7583cc08441e2dee8f0f07db5cb2c7b8f06c13d | 1,775 | py | Python | myapp/views.py | free20064u/flower | fa8dd4b522ede930baf8cd4e533c869ebf9cf009 | [
"MIT"
] | null | null | null | myapp/views.py | free20064u/flower | fa8dd4b522ede930baf8cd4e533c869ebf9cf009 | [
"MIT"
] | null | null | null | myapp/views.py | free20064u/flower | fa8dd4b522ede930baf8cd4e533c869ebf9cf009 | [
"MIT"
] | null | null | null | from django.http.response import HttpResponseRedirect
from .forms import MyForm
from django.shortcuts import get_object_or_404, render
from .models import Flower
# Create your views here.
def index(request):
q = request.GET.get("q" , None)
if q is None or q == '':
flowers = Flower.objects.all()
e... | 23.666667 | 59 | 0.609014 | from django.http.response import HttpResponseRedirect
from .forms import MyForm
from django.shortcuts import get_object_or_404, render
from .models import Flower
def index(request):
q = request.GET.get("q" , None)
if q is None or q == '':
flowers = Flower.objects.all()
else:
flowers = Fl... | true | true |
f7583d24b76d4172a735df22a8593c1a04c0e69d | 97,511 | py | Python | lib/googlecloudsdk/third_party/apis/container/v1/container_v1_client.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/container/v1/container_v1_client.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/container/v1/container_v1_client.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | """Generated client library for container version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.container.v1 import container_v1_messages as messages
class ContainerV1(base_api.BaseApiClient):
"""Generated clien... | 41.529387 | 162 | 0.699983 |
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.container.v1 import container_v1_messages as messages
class ContainerV1(base_api.BaseApiClient):
MESSAGES_MODULE = messages
BASE_URL = u'https://container.googleapis.com/'
_PACKAGE = u'container'
_SCOPES = [u'https://www.googleapis.... | true | true |
f7583f3c89da3d4e9ea5d5c4fffa4b29559b7e57 | 4,814 | py | Python | py/desispec/scripts/humidity_corrected_fiberflat.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/scripts/humidity_corrected_fiberflat.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/scripts/humidity_corrected_fiberflat.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | null | null | null |
from __future__ import absolute_import, division
import os
import fitsio
import argparse
import numpy as np
from desiutil.log import get_logger
from desispec.io import read_fiberflat,write_fiberflat,findfile,read_frame
from desispec.io.fiberflat_vs_humidity import get_humidity,read_fiberflat_vs_humidity
from desisp... | 42.60177 | 162 | 0.706689 |
from __future__ import absolute_import, division
import os
import fitsio
import argparse
import numpy as np
from desiutil.log import get_logger
from desispec.io import read_fiberflat,write_fiberflat,findfile,read_frame
from desispec.io.fiberflat_vs_humidity import get_humidity,read_fiberflat_vs_humidity
from desisp... | true | true |
f7583fb701918f9c6e7a5e121889947b3be0dd37 | 2,457 | py | Python | aliyun-python-sdk-pvtz/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-pvtz/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-pvtz/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | #!/usr/bin/python
'''
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"... | 31.5 | 69 | 0.667074 |
from setuptools import setup, find_packages
import os
import sys
PACKAGE = "aliyunsdkpvtz"
NAME = "aliyun-python-sdk-pvtz"
DESCRIPTION = "The pvtz module of Aliyun Python sdk."
AUTHOR = "Aliyun"
AUTHOR_EMAIL = "aliyun-developers-efficiency@list.alibaba-inc.com"
URL = "http://develop.aliyun.com/sdk/python"
TOPDIR =... | true | true |
f7583fc4c9097b64056f608e2672e22f661db942 | 501 | py | Python | classes/phsyics.py | hey-waffles/dungeon-crawler | ca410b3c9200eed3ac060a3cdbdd3773cfca5889 | [
"MIT"
] | null | null | null | classes/phsyics.py | hey-waffles/dungeon-crawler | ca410b3c9200eed3ac060a3cdbdd3773cfca5889 | [
"MIT"
] | 3 | 2018-11-18T15:36:47.000Z | 2019-04-21T03:30:38.000Z | classes/phsyics.py | hey-waffles/dungeon-crawler | ca410b3c9200eed3ac060a3cdbdd3773cfca5889 | [
"MIT"
] | null | null | null | def getVelocity(speed, vector):
"""
Converts a speed and vector into a velocity array [x, y, z]
X is horizontal movement, Y is vertical movement, and Z is movement in/out of screen
arg speed - the speed scalar
arg vector - the direction in radians that the object is moving in
Returns an array with the x, y, z... | 38.538462 | 85 | 0.718563 | def getVelocity(speed, vector):
# In the future, add functionality for two angles
return [math.cos(vector) * speed, math.sin(vector) * speed, 0] | true | true |
f758409ca3b168b5ac51eca59e77dc234241290c | 2,538 | py | Python | funcmeasure/funcmeasure.py | kkristof200/py_funcmeasure | 0cf910e7759466df60bcd6fa411051d36088f97d | [
"MIT"
] | null | null | null | funcmeasure/funcmeasure.py | kkristof200/py_funcmeasure | 0cf910e7759466df60bcd6fa411051d36088f97d | [
"MIT"
] | null | null | null | funcmeasure/funcmeasure.py | kkristof200/py_funcmeasure | 0cf910e7759466df60bcd6fa411051d36088f97d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------- Imports ---------------------------------------------------------------- #
# System
from typing import List, Callable, Union, Tuple, Dict, Optional
# Local
from ._utils import FunctionMeasurer, Renderer
from .models import FunctionStats, TableFormat
#... | 39.65625 | 184 | 0.50985 |
from typing import List, Callable, Union, Tuple, Dict, Optional
from ._utils import FunctionMeasurer, Renderer
from .models import FunctionStats, TableFormat
def measure(
funcs: Union[List[Union[Callable, Tuple[Callable, str]]], Dict[Callable, Optional[str]]],
times: int = 1000,
print_benchmark: bo... | true | true |
f75841daa753f5286d83b38d623784021e0d1c2a | 231 | py | Python | hiddeneye_reborn/hiddeneye_reborn.py | Mr-Anonymous002/HiddenEyeReborn | 3a7542d9fd68bd193897f702930c208dceed0994 | [
"Unlicense"
] | 2 | 2021-06-24T17:14:11.000Z | 2022-01-26T13:44:21.000Z | hiddeneye_reborn/hiddeneye_reborn.py | Mr-Anonymous002/HiddenEyeReborn | 3a7542d9fd68bd193897f702930c208dceed0994 | [
"Unlicense"
] | 1 | 2021-12-13T20:55:32.000Z | 2021-12-13T20:55:32.000Z | hiddeneye_reborn/hiddeneye_reborn.py | Mr-Anonymous002/HiddenEyeReborn | 3a7542d9fd68bd193897f702930c208dceed0994 | [
"Unlicense"
] | 1 | 2021-06-24T17:14:16.000Z | 2021-06-24T17:14:16.000Z |
def main():
print("Success, you can access this via terminal!")
print("Hey, if you can - contact that lazy developer and make him code! Would be glad if you contribute, as well...")
if __name__ == "__main__":
main()
| 25.666667 | 121 | 0.666667 |
def main():
print("Success, you can access this via terminal!")
print("Hey, if you can - contact that lazy developer and make him code! Would be glad if you contribute, as well...")
if __name__ == "__main__":
main()
| true | true |
f7584364fa4db48ae168dd840e39d935cba8338f | 1,787 | py | Python | negative-affect/pain_regression.py | bjsmith/reversallearning | 023304731d41c3109bacbfd49d4c850a92353978 | [
"Apache-2.0"
] | null | null | null | negative-affect/pain_regression.py | bjsmith/reversallearning | 023304731d41c3109bacbfd49d4c850a92353978 | [
"Apache-2.0"
] | null | null | null | negative-affect/pain_regression.py | bjsmith/reversallearning | 023304731d41c3109bacbfd49d4c850a92353978 | [
"Apache-2.0"
] | 2 | 2017-08-15T22:00:15.000Z | 2019-05-11T22:40:20.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 19 17:53:46 2017
@author: benjaminsmith
"""
#do the regression in the
#we need a design matrix
#with linear, square, cubic time point regressors
#plus intercept
#plus whatever Design_Matrix files we want to put in.
onsets_convolved.head()
onsets... | 26.279412 | 84 | 0.711248 |
onsets_convolved.head()
onsets_convolved['linearterm']=range(1,361)
onsets_convolved['quadraticterm']=[pow(x,2) for x in onsets_convolved['linearterm']]
onsets_convolved['cubicterm']=[pow(x,3) for x in onsets_convolved['linearterm']]
onsets_convolved['ones']=[1]*360
c.head()
onsets_convolved.heatmap()
onset... | true | true |
f758437e33f3e38aaadde6205d21e4585761a216 | 2,724 | py | Python | InputPipeline/AlignedDataset.py | Wenyuan-Vincent-Li/SSL_Seg_GAN | 8f6c45fd000ea12468dccf211b376fadbf4759c6 | [
"Apache-2.0"
] | 1 | 2022-03-09T11:51:22.000Z | 2022-03-09T11:51:22.000Z | InputPipeline/AlignedDataset.py | Wenyuan-Vincent-Li/SSL_Seg_GAN | 8f6c45fd000ea12468dccf211b376fadbf4759c6 | [
"Apache-2.0"
] | null | null | null | InputPipeline/AlignedDataset.py | Wenyuan-Vincent-Li/SSL_Seg_GAN | 8f6c45fd000ea12468dccf211b376fadbf4759c6 | [
"Apache-2.0"
] | null | null | null | import os.path
from InputPipeline.base_dataset import BaseDataset, get_params, get_transform, get_downscale_transform
from InputPipeline.image_folder import make_dataset
from PIL import Image
import torchvision.transforms as transforms
from Training.imresize import imresize_single
class AlignedDataset(BaseDataset):
... | 38.914286 | 120 | 0.638032 | import os.path
from InputPipeline.base_dataset import BaseDataset, get_params, get_transform, get_downscale_transform
from InputPipeline.image_folder import make_dataset
from PIL import Image
import torchvision.transforms as transforms
from Training.imresize import imresize_single
class AlignedDataset(BaseDataset):
... | true | true |
f75843f527605b2b86b9ce3419f95852942e5038 | 3,935 | py | Python | scvi/model/_scvi.py | morris-frank/scvi-tools | b828c75455bdd9e9558882d0b110ed97ba135184 | [
"BSD-3-Clause"
] | 1 | 2019-05-21T04:57:35.000Z | 2019-05-21T04:57:35.000Z | scvi/model/_scvi.py | morris-frank/scvi-tools | b828c75455bdd9e9558882d0b110ed97ba135184 | [
"BSD-3-Clause"
] | null | null | null | scvi/model/_scvi.py | morris-frank/scvi-tools | b828c75455bdd9e9558882d0b110ed97ba135184 | [
"BSD-3-Clause"
] | 1 | 2020-01-17T13:34:51.000Z | 2020-01-17T13:34:51.000Z | import logging
from anndata import AnnData
from scvi._compat import Literal
from scvi.model.base import UnsupervisedTrainingMixin
from scvi.module import VAE
from .base import ArchesMixin, BaseModelClass, RNASeqMixin, VAEMixin
logger = logging.getLogger(__name__)
class SCVI(
RNASeqMixin, VAEMixin, ArchesMixin... | 33.347458 | 110 | 0.622618 | import logging
from anndata import AnnData
from scvi._compat import Literal
from scvi.model.base import UnsupervisedTrainingMixin
from scvi.module import VAE
from .base import ArchesMixin, BaseModelClass, RNASeqMixin, VAEMixin
logger = logging.getLogger(__name__)
class SCVI(
RNASeqMixin, VAEMixin, ArchesMixin... | true | true |
f758456d77fa915c2fee922ac139a2dd4efb71c8 | 5,642 | py | Python | Assignment 2/Second Part/russian_classifier.py | egryaznov/nlpmovies | 4f2c5ffbcff12f279dc2622471e1b19175607f67 | [
"MIT"
] | null | null | null | Assignment 2/Second Part/russian_classifier.py | egryaznov/nlpmovies | 4f2c5ffbcff12f279dc2622471e1b19175607f67 | [
"MIT"
] | null | null | null | Assignment 2/Second Part/russian_classifier.py | egryaznov/nlpmovies | 4f2c5ffbcff12f279dc2622471e1b19175607f67 | [
"MIT"
] | null | null | null | # IMDB Movie Review Sentiment Classification
# Second Assignment Solution
# NLP Course, Innopolis University, Spring 2017
# Author: Evgeny Gryaznov
import numpy
import ru_otzyv as ru
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from ke... | 37.613333 | 101 | 0.697093 |
import numpy
import ru_otzyv as ru
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers.embeddings import Embedding
from keras.preprocessing import sequence
def compile_model(topn=20000, max_review_length=300, embedding... | true | true |
f758457ada034f543c09876f2a8c925a58b2723d | 22,318 | py | Python | tests/integration/ci-runner.py | evryfs/ClickHouse | a9648af0b9e2506ce783106315814ed8dbd0a952 | [
"Apache-2.0"
] | null | null | null | tests/integration/ci-runner.py | evryfs/ClickHouse | a9648af0b9e2506ce783106315814ed8dbd0a952 | [
"Apache-2.0"
] | null | null | null | tests/integration/ci-runner.py | evryfs/ClickHouse | a9648af0b9e2506ce783106315814ed8dbd0a952 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import logging
import subprocess
import os
import time
import shutil
from collections import defaultdict
import random
import json
import csv
MAX_RETRY = 2
SLEEP_BETWEEN_RETRIES = 5
CLICKHOUSE_BINARY_PATH = "/usr/bin/clickhouse"
CLICKHOUSE_ODBC_BRIDGE_BINARY_PATH = "/usr/bin/clickhouse-odbc-br... | 42.510476 | 176 | 0.602608 |
import logging
import subprocess
import os
import time
import shutil
from collections import defaultdict
import random
import json
import csv
MAX_RETRY = 2
SLEEP_BETWEEN_RETRIES = 5
CLICKHOUSE_BINARY_PATH = "/usr/bin/clickhouse"
CLICKHOUSE_ODBC_BRIDGE_BINARY_PATH = "/usr/bin/clickhouse-odbc-bridge"
TRIES_COUNT = 1... | true | true |
f75846725ca7593ba2f2a50621f67a566b73f02a | 13,108 | py | Python | main/huts/HutDescription.py | wodore/mtn-huts | c52b26ee6a367b8552bf12b62e5303006ca1e873 | [
"MIT"
] | null | null | null | main/huts/HutDescription.py | wodore/mtn-huts | c52b26ee6a367b8552bf12b62e5303006ca1e873 | [
"MIT"
] | null | null | null | main/huts/HutDescription.py | wodore/mtn-huts | c52b26ee6a367b8552bf12b62e5303006ca1e873 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 07:10:14 2020
@author: tobias
"""
# import requests
# import time
import datetime
import locale
from flask_babel import _
# import threading
# from concurrent.futures import Future
# try:
# from .GPSConverter import GPSConverter
# except ImportError: # for local t... | 32.526055 | 887 | 0.550504 |
import datetime
import locale
from flask_babel import _
yle>
.hut-info a:link, .hut-info a:visited {
text-decoration: none;
color: #31708f;
}
.hut-info a:hover {
text-decoration: underline;
color: #31708f;
}
#hut-icon-title {
width: 30px;
}
.img-text {
vertical-align: t... | true | true |
f7584971ab0c21c1fa32e7b97b0f81d198afecc2 | 18,433 | py | Python | formencode/schema.py | pgajdos/formencode | fe29722f3398fd0b1df7d7db4278a0b2d5f8fda3 | [
"MIT"
] | 63 | 2015-02-14T11:49:59.000Z | 2022-02-02T22:15:16.000Z | formencode/schema.py | pgajdos/formencode | fe29722f3398fd0b1df7d7db4278a0b2d5f8fda3 | [
"MIT"
] | 102 | 2015-01-08T18:01:46.000Z | 2022-01-25T01:20:09.000Z | formencode/schema.py | pgajdos/formencode | fe29722f3398fd0b1df7d7db4278a0b2d5f8fda3 | [
"MIT"
] | 44 | 2015-01-11T13:22:57.000Z | 2021-12-02T08:54:17.000Z | from __future__ import absolute_import
import warnings
from .api import _, is_validator, FancyValidator, Invalid, NoDefault
from . import declarative
from .exc import FERuntimeWarning
import six
from six.moves import map
from six.moves import zip
__all__ = ['Schema']
class Schema(FancyValidator):
"""
A sch... | 36.792415 | 79 | 0.565942 | from __future__ import absolute_import
import warnings
from .api import _, is_validator, FancyValidator, Invalid, NoDefault
from . import declarative
from .exc import FERuntimeWarning
import six
from six.moves import map
from six.moves import zip
__all__ = ['Schema']
class Schema(FancyValidator):
pre_val... | true | true |
f75849a4d756f9f38bad81fb5022bd95fbec0096 | 12,595 | py | Python | 1-lxastro0/code_local/utils/create_dataset.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | 1-lxastro0/code_local/utils/create_dataset.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | 1-lxastro0/code_local/utils/create_dataset.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | import collections
import logging
import os
import warnings
from pathlib import Path
from typing import List, Union
import h5py
from torch.utils.data import Dataset
import numpy as np
import models.coordconv
from utils.utils import get_key_def, ordereddict_eval, compare_config_yamls
from utils.geoutils import get_key... | 49.782609 | 176 | 0.634458 | import collections
import logging
import os
import warnings
from pathlib import Path
from typing import List, Union
import h5py
from torch.utils.data import Dataset
import numpy as np
import models.coordconv
from utils.utils import get_key_def, ordereddict_eval, compare_config_yamls
from utils.geoutils import get_key... | true | true |
f75849d7bcd3f303c88b6e46349b086eafb378a8 | 5,263 | py | Python | configs/yolact/yolact_r50_1x8_coco.py | hmtrii/mmdetection | a998e0ac45118482b4a1fa320c2f0611f35fb0d1 | [
"Apache-2.0"
] | null | null | null | configs/yolact/yolact_r50_1x8_coco.py | hmtrii/mmdetection | a998e0ac45118482b4a1fa320c2f0611f35fb0d1 | [
"Apache-2.0"
] | null | null | null | configs/yolact/yolact_r50_1x8_coco.py | hmtrii/mmdetection | a998e0ac45118482b4a1fa320c2f0611f35fb0d1 | [
"Apache-2.0"
] | null | null | null | _base_ = '../_base_/default_runtime.py'
# model settings
img_size = 550
model = dict(
type='YOLACT',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1, # do not freeze stem
norm_cfg=dict(type='BN', requi... | 32.689441 | 80 | 0.566407 | _base_ = '../_base_/default_runtime.py'
img_size = 550
model = dict(
type='YOLACT',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=Fal... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.