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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c33e3bca8133ca52ee4a9c179c8779b0c8dd328 | 2,087 | py | Python | examples/ExGroup.py | janjusti/dcma | 4403b176f33967d446275ee35422ec31236ce7a6 | [
"MIT"
] | null | null | null | examples/ExGroup.py | janjusti/dcma | 4403b176f33967d446275ee35422ec31236ce7a6 | [
"MIT"
] | null | null | null | examples/ExGroup.py | janjusti/dcma | 4403b176f33967d446275ee35422ec31236ce7a6 | [
"MIT"
] | null | null | null | from Bio import Entrez, AlignIO, SeqIO
from Bio.Align import AlignInfo
from Bio.SeqRecord import SeqRecord
from Bio.Align.Applications import MuscleCommandline
import dcma.core as solver
import time
def generate_fasta_from_ids(id_list, fasta_output):
Entrez.email = 'example@example.com'
f = open(fasta_output, ... | 35.982759 | 87 | 0.698131 | from Bio import Entrez, AlignIO, SeqIO
from Bio.Align import AlignInfo
from Bio.SeqRecord import SeqRecord
from Bio.Align.Applications import MuscleCommandline
import dcma.core as solver
import time
def generate_fasta_from_ids(id_list, fasta_output):
Entrez.email = 'example@example.com'
f = open(fasta_output, ... | true | true |
1c33e502e953fb501cea4f12595b4840aca73557 | 1,156 | py | Python | .modules/.recon-ng/modules/recon/hosts-domains/migrate_hosts.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.recon-ng/modules/recon/hosts-domains/migrate_hosts.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.recon-ng/modules/recon/hosts-domains/migrate_hosts.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 161 | 2018-04-20T15:57:12.000Z | 2022-03-15T19:16:16.000Z | from recon.core.module import BaseModule
import os
import re
class Module(BaseModule):
meta = {
'name': 'Hosts to Domains Data Migrator',
'author': 'Tim Tomes (@LaNMaSteR53)',
'description': 'Adds a new domain for all the hostnames stored in the \'hosts\' table.',
'comments': (
... | 42.814815 | 202 | 0.622837 | from recon.core.module import BaseModule
import os
import re
class Module(BaseModule):
meta = {
'name': 'Hosts to Domains Data Migrator',
'author': 'Tim Tomes (@LaNMaSteR53)',
'description': 'Adds a new domain for all the hostnames stored in the \'hosts\' table.',
'comments': (
... | true | true |
1c33e56e472ec7115c80b8127bbef8760db518c3 | 5,466 | py | Python | codes/singintex.py | Hadrien-Montanelli/singintpy | 1706afe42d0cc6e0f3c53759d489f7209e50ef29 | [
"MIT"
] | null | null | null | codes/singintex.py | Hadrien-Montanelli/singintpy | 1706afe42d0cc6e0f3c53759d489f7209e50ef29 | [
"MIT"
] | null | null | null | codes/singintex.py | Hadrien-Montanelli/singintpy | 1706afe42d0cc6e0f3c53759d489f7209e50ef29 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 28 19:24:38 2021
Copyright 2021 by Hadrien Montanelli.
"""
def singintex(u0, v0, dz0):
"""
# Outputs the exact value (computed in Mathematica) of the singular and
# near-singular integrals used in the numerical experiments of [1, Sec. 4]... | 43.728 | 80 | 0.526528 | def singintex(u0, v0, dz0):
if (u0 == .2) and (v0 == .4) and (dz0 == 0): Iex = 3.240017458404107
if (u0 == .2) and (v0 == .4) and (dz0 == 1e-4): Iex = 3.239493851850319
if (u0 == .2) and (v0 == .4) and (dz0 == 1e-3): Iex = 3.234785969247374
if (u0 == .2) and (v0 == .4) and (d... | true | true |
1c33e63b7914a838eed8ad9be6312285010e66b4 | 3,013 | py | Python | src/dsgrn_net_gen/makejobs.py | breecummins/dsgrn_net_gen | bcd77b71ad3e311d2906f0af986559d2c54ffe6d | [
"MIT"
] | 1 | 2020-03-31T18:44:06.000Z | 2020-03-31T18:44:06.000Z | src/dsgrn_net_gen/makejobs.py | breecummins/dsgrn_net_gen | bcd77b71ad3e311d2906f0af986559d2c54ffe6d | [
"MIT"
] | null | null | null | src/dsgrn_net_gen/makejobs.py | breecummins/dsgrn_net_gen | bcd77b71ad3e311d2906f0af986559d2c54ffe6d | [
"MIT"
] | null | null | null | import dsgrn_net_gen.networksearch as networksearch
import dsgrn_net_gen.fileparsers as fileparsers
import subprocess, os, json, shutil, ast, sys, time
class Job():
def __init__(self,paramfile):
self.paramfile = paramfile
self.params = json.load(open(paramfile))
# use datetime as unique i... | 41.847222 | 122 | 0.615002 | import dsgrn_net_gen.networksearch as networksearch
import dsgrn_net_gen.fileparsers as fileparsers
import subprocess, os, json, shutil, ast, sys, time
class Job():
def __init__(self,paramfile):
self.paramfile = paramfile
self.params = json.load(open(paramfile))
if "datetime" not ... | true | true |
1c33e67d7a8d75efca51a7f3cd2d594c96a6efdf | 1,279 | py | Python | quad_garl/garl.py | kanishkaganguly/QuadGARL | 2e995861cab98d9623dd36155cb472dcb4e21cd0 | [
"MIT"
] | 1 | 2019-02-08T06:17:34.000Z | 2019-02-08T06:17:34.000Z | quad_garl/garl.py | kanishkaganguly/QuadGARL | 2e995861cab98d9623dd36155cb472dcb4e21cd0 | [
"MIT"
] | null | null | null | quad_garl/garl.py | kanishkaganguly/QuadGARL | 2e995861cab98d9623dd36155cb472dcb4e21cd0 | [
"MIT"
] | null | null | null | from typing import List
from quad_garl import quad_utils
from quad_garl.garl_utils import GARLUtils
from quad_garl.genetic_algorithm import GeneticAlgorithm
from quad_garl.quad_simulator import Quadcopter
from quad_garl.reinforcement_learning import ReinforcementLearning
def main():
# Variables
chromosome_si... | 26.645833 | 96 | 0.677873 | from typing import List
from quad_garl import quad_utils
from quad_garl.garl_utils import GARLUtils
from quad_garl.genetic_algorithm import GeneticAlgorithm
from quad_garl.quad_simulator import Quadcopter
from quad_garl.reinforcement_learning import ReinforcementLearning
def main():
chromosome_size = 10 ... | true | true |
1c33e6e12dcd7bb838f2c7f2077f8cc747f84551 | 13,234 | py | Python | tests/plugins/db2_test.py | flyingbarron/detect-secrets | 5f9887179794ce037d97c1b343623eb5937ce800 | [
"Apache-2.0"
] | null | null | null | tests/plugins/db2_test.py | flyingbarron/detect-secrets | 5f9887179794ce037d97c1b343623eb5937ce800 | [
"Apache-2.0"
] | null | null | null | tests/plugins/db2_test.py | flyingbarron/detect-secrets | 5f9887179794ce037d97c1b343623eb5937ce800 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import textwrap
import pytest
from mock import MagicMock
from mock import patch
from detect_secrets.core.constants import VerifiedResult
from detect_secrets.core.potential_secret import PotentialSecret
from detect_secrets.plugins.db2 import Db2Detector
from detect_secrets.plugi... | 37.070028 | 95 | 0.584328 | from __future__ import absolute_import
import textwrap
import pytest
from mock import MagicMock
from mock import patch
from detect_secrets.core.constants import VerifiedResult
from detect_secrets.core.potential_secret import PotentialSecret
from detect_secrets.plugins.db2 import Db2Detector
from detect_secrets.plugi... | true | true |
1c33e6f6a138884a527d0ffde240901b01d5617b | 6,981 | py | Python | tests/app/api_v0/test_revisions.py | xwu64/server | d358db21db4a8faf33a3681fc499aeea07e9784b | [
"BSD-3-Clause"
] | null | null | null | tests/app/api_v0/test_revisions.py | xwu64/server | d358db21db4a8faf33a3681fc499aeea07e9784b | [
"BSD-3-Clause"
] | null | null | null | tests/app/api_v0/test_revisions.py | xwu64/server | d358db21db4a8faf33a3681fc499aeea07e9784b | [
"BSD-3-Clause"
] | null | null | null | # TODO: split E2E test to unit test
import pytest
from starlette.testclient import TestClient
from tests.fixtures.mock_service import MockUserService
__all__ = ["test_person_revisions_basic",
"test_person_revisions_offset",
"test_person_revisions_offset_limit",
"test_character_revisi... | 29.0875 | 88 | 0.664661 |
import pytest
from starlette.testclient import TestClient
from tests.fixtures.mock_service import MockUserService
__all__ = ["test_person_revisions_basic",
"test_person_revisions_offset",
"test_person_revisions_offset_limit",
"test_character_revisions_basic",
"test_charact... | true | true |
1c33e80294a94d85a9edbb95747f6f5c2e32304a | 1,387 | py | Python | python/ecs/fargate-load-balanced-service/app.py | samtwil/aws-cdk-examples | a0ca373be2bd4e82f888f903fdb7c57d36d5537f | [
"Apache-2.0"
] | null | null | null | python/ecs/fargate-load-balanced-service/app.py | samtwil/aws-cdk-examples | a0ca373be2bd4e82f888f903fdb7c57d36d5537f | [
"Apache-2.0"
] | null | null | null | python/ecs/fargate-load-balanced-service/app.py | samtwil/aws-cdk-examples | a0ca373be2bd4e82f888f903fdb7c57d36d5537f | [
"Apache-2.0"
] | null | null | null | from aws_cdk import (
aws_autoscaling as autoscaling,
aws_ec2 as ec2,
aws_ecs as ecs,
aws_ecs_patterns as ecs_patterns,
App, CfnOutput, Stack
)
from constructs import Construct
class BonjourFargate(Stack):
def __init__(self, scope: Construct, id: str, **kwargs) -> None:
super().__init... | 27.74 | 82 | 0.617159 | from aws_cdk import (
aws_autoscaling as autoscaling,
aws_ec2 as ec2,
aws_ecs as ecs,
aws_ecs_patterns as ecs_patterns,
App, CfnOutput, Stack
)
from constructs import Construct
class BonjourFargate(Stack):
def __init__(self, scope: Construct, id: str, **kwargs) -> None:
super().__init... | true | true |
1c33eb22ed93e91c820b6bf40b6fff5c184acf47 | 1,225 | py | Python | tests/core/extraction/test_mapping_analyzer.py | ymoch/preacher | ae68170d14c72791884e91b20054bd13a79b52d0 | [
"MIT"
] | 3 | 2019-08-01T03:14:49.000Z | 2020-01-31T08:55:22.000Z | tests/core/extraction/test_mapping_analyzer.py | ymoch/preacher | ae68170d14c72791884e91b20054bd13a79b52d0 | [
"MIT"
] | 353 | 2019-04-14T14:53:28.000Z | 2022-03-11T03:26:08.000Z | tests/core/extraction/test_mapping_analyzer.py | ymoch/preacher | ae68170d14c72791884e91b20054bd13a79b52d0 | [
"MIT"
] | 1 | 2020-08-01T06:23:08.000Z | 2020-08-01T06:23:08.000Z | from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Mapping
from unittest.mock import sentinel
from lxml.etree import _Element as Element
from pytest import raises
from preacher.core.extraction.analysis import MappingAnalyzer
from preacher.core.extraction.error import Extracti... | 26.06383 | 78 | 0.713469 | from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Mapping
from unittest.mock import sentinel
from lxml.etree import _Element as Element
from pytest import raises
from preacher.core.extraction.analysis import MappingAnalyzer
from preacher.core.extraction.error import Extracti... | true | true |
1c33ebd38ae22627863e394b94ce67736dfeaaf2 | 927 | py | Python | users/migrations/0011_auto_20210412_1908.py | msking18/minor | 17cffab95b5dc1705a131a1ef66ff7f47837de64 | [
"MIT"
] | 3 | 2021-03-22T10:39:18.000Z | 2021-04-30T10:29:37.000Z | users/migrations/0011_auto_20210412_1908.py | msking18/minor | 17cffab95b5dc1705a131a1ef66ff7f47837de64 | [
"MIT"
] | 1 | 2021-04-16T06:54:10.000Z | 2021-04-16T06:54:10.000Z | users/migrations/0011_auto_20210412_1908.py | msking18/minor | 17cffab95b5dc1705a131a1ef66ff7f47837de64 | [
"MIT"
] | 3 | 2021-03-11T10:02:37.000Z | 2021-04-23T07:34:10.000Z | # Generated by Django 3.1.6 on 2021-04-12 13:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_remove_profile_date_of_birth'),
]
operations = [
migrations.AddField(
model_name='profile',
name='bran... | 27.264706 | 72 | 0.567422 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_remove_profile_date_of_birth'),
]
operations = [
migrations.AddField(
model_name='profile',
name='branch',
field=models.CharField(default=... | true | true |
1c33ee1592f2be0a3d6959054ddbc20841c3550a | 2,584 | py | Python | base.py | sosterbind/hexaRanger | a0b888061af4858c78962ed8c0154531f00e8455 | [
"MIT"
] | null | null | null | base.py | sosterbind/hexaRanger | a0b888061af4858c78962ed8c0154531f00e8455 | [
"MIT"
] | null | null | null | base.py | sosterbind/hexaRanger | a0b888061af4858c78962ed8c0154531f00e8455 | [
"MIT"
] | null | null | null | from typing import (
Optional,
List,
Tuple,
Dict,
)
from abc import (
ABC,
abstractmethod,
)
class StoreClient(ABC):
__slots__ = ()
@classmethod
@abstractmethod
def query_range_count(
cls,
start_key: Optional[str] = None,
stop_key: Optional[str] = None,... | 23.279279 | 72 | 0.629257 | from typing import (
Optional,
List,
Tuple,
Dict,
)
from abc import (
ABC,
abstractmethod,
)
class StoreClient(ABC):
__slots__ = ()
@classmethod
@abstractmethod
def query_range_count(
cls,
start_key: Optional[str] = None,
stop_key: Optional[str] = None,... | true | true |
1c33ef9ee86a9ecba33247c529a8b2b9daa28e69 | 532 | py | Python | Mundo1/des33.py | julimoraislima/Python-CursoEmVideo | d21b0485d2f5767039d819cf743255dfd0f27b18 | [
"MIT"
] | 2 | 2021-01-05T12:31:00.000Z | 2021-03-20T00:31:18.000Z | Mundo1/des33.py | julimoraislima/Python-CursoEmVideo | d21b0485d2f5767039d819cf743255dfd0f27b18 | [
"MIT"
] | null | null | null | Mundo1/des33.py | julimoraislima/Python-CursoEmVideo | d21b0485d2f5767039d819cf743255dfd0f27b18 | [
"MIT"
] | 1 | 2020-12-28T22:56:10.000Z | 2020-12-28T22:56:10.000Z | #desafio 33: Maior e Menor. Programa lê 3 valores, e retorna o maior e o menor valor.
#1-maneira simplificada usando uma lista[].
primeiro = int(input('Digite o primeiro valor inteiro: '))
segundo = int(input('Digite o segundo valor inteiro: '))
terceiro = int(input('Digite o terceiro valor inteiro: '))
numeros = [pri... | 38 | 85 | 0.708647 |
primeiro = int(input('Digite o primeiro valor inteiro: '))
segundo = int(input('Digite o segundo valor inteiro: '))
terceiro = int(input('Digite o terceiro valor inteiro: '))
numeros = [primeiro, segundo, terceiro]
print('-+-'*20)
print(f'O \33[31mmaior\33[m valor digitado foi \33[31m{max(numeros)}\33[m')
print(f'O \3... | true | true |
1c33f01fc1c0b21826cb0fe8d7917484a3137ed5 | 560 | py | Python | scripts/mv_rednet.py | albert-yue/objectnav | 95ce9bc2c1d953887275e8d9809a506aeb5682fb | [
"MIT",
"Unlicense"
] | 15 | 2021-04-12T04:36:14.000Z | 2022-03-20T04:16:36.000Z | scripts/mv_rednet.py | albert-yue/objectnav | 95ce9bc2c1d953887275e8d9809a506aeb5682fb | [
"MIT",
"Unlicense"
] | 4 | 2021-07-12T18:14:08.000Z | 2021-11-11T13:44:34.000Z | scripts/mv_rednet.py | albert-yue/objectnav | 95ce9bc2c1d953887275e8d9809a506aeb5682fb | [
"MIT",
"Unlicense"
] | 10 | 2021-06-23T23:14:16.000Z | 2022-03-20T07:47:32.000Z | #%%
# Move files around for rednet
from pathlib import Path
from shutil import move
detailed_paths = Path('/srv/flash1/jye72/share/objectnav_detailed')
eval_paths = Path('/srv/flash1/jye72/share/objectnav_eval')
KEY = 'gt_False.pth'
NEW_KEY = 'gt_False_21.pth'
for var_path in eval_paths.glob("*"):
# for var_path in d... | 28 | 67 | 0.633929 | from pathlib import Path
from shutil import move
detailed_paths = Path('/srv/flash1/jye72/share/objectnav_detailed')
eval_paths = Path('/srv/flash1/jye72/share/objectnav_eval')
KEY = 'gt_False.pth'
NEW_KEY = 'gt_False_21.pth'
for var_path in eval_paths.glob("*"):
for ckpt in var_path.glob("*"):
for val in... | true | true |
1c33f09cfd5449e71f3c16d72f5d6bf8a34449c9 | 3,500 | py | Python | client.py | murilopereirame/ChatUDP | 979a8ed5927bb0a431314cad2e36505bbbb256c2 | [
"MIT"
] | null | null | null | client.py | murilopereirame/ChatUDP | 979a8ed5927bb0a431314cad2e36505bbbb256c2 | [
"MIT"
] | null | null | null | client.py | murilopereirame/ChatUDP | 979a8ed5927bb0a431314cad2e36505bbbb256c2 | [
"MIT"
] | null | null | null | import socket
import threading
import random
import json
import sys
from RSA import RSA
class Client:
SERVER_UDP_IP_ADDRESS = "127.0.0.1"
SERVER_UDP_PORT_NO = 6789
user = ""
room = "geral"
clientSock = None
def __init__(self, ip):
self.SERVER_UDP_IP_ADDRESS = ip
self.room = 'l... | 34.653465 | 92 | 0.532286 | import socket
import threading
import random
import json
import sys
from RSA import RSA
class Client:
SERVER_UDP_IP_ADDRESS = "127.0.0.1"
SERVER_UDP_PORT_NO = 6789
user = ""
room = "geral"
clientSock = None
def __init__(self, ip):
self.SERVER_UDP_IP_ADDRESS = ip
self.room = 'l... | true | true |
1c33f0e69444ade9a5b966e522f9e8149c28c794 | 1,608 | py | Python | fastreid/layers/rfconv/function.py | SZLSP/reid2020NAIC | d0eaee768e0be606417a27ce5ea2b3071b5a9bc2 | [
"Apache-2.0"
] | 2 | 2021-05-12T13:36:46.000Z | 2021-08-15T10:35:08.000Z | fastreid/layers/rfconv/function.py | SZLSP/reid2020NAIC | d0eaee768e0be606417a27ce5ea2b3071b5a9bc2 | [
"Apache-2.0"
] | 1 | 2021-12-28T12:49:49.000Z | 2021-12-28T12:49:49.000Z | fastreid/layers/rfconv/function.py | SZLSP/reid2020NAIC | d0eaee768e0be606417a27ce5ea2b3071b5a9bc2 | [
"Apache-2.0"
] | null | null | null | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang
## Email: zhanghang0704@gmail.com
## Copyright (c) 2020
##
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""Rectify function"""
f... | 32.816327 | 87 | 0.55597 |
from torch.autograd import Function
from . import lib
__all__ = ['rectify']
class _rectify(Function):
@staticmethod
def forward(ctx, y, x, kernel_size, stride, padding, dilation, average):
ctx.save_for_backward(x)
kernel_size = [k + 2 * (d - 1) for k, d in zip(kernel_size, dilation)... | true | true |
1c33f10cfc5099f1a9b12d2e015bf0dafde36b97 | 9,559 | py | Python | tensorflow/python/ops/control_flow_grad.py | KosingZhu/tensorflow | 7ac2521a4e609ddef0f0ea3ffc2e76102da934d7 | [
"Apache-2.0"
] | 9 | 2021-11-06T11:09:48.000Z | 2021-12-12T04:52:29.000Z | tensorflow/python/ops/control_flow_grad.py | KosingZhu/tensorflow | 7ac2521a4e609ddef0f0ea3ffc2e76102da934d7 | [
"Apache-2.0"
] | 2 | 2021-10-06T23:12:04.000Z | 2021-10-06T23:12:04.000Z | tensorflow/python/ops/control_flow_grad.py | KosingZhu/tensorflow | 7ac2521a4e609ddef0f0ea3ffc2e76102da934d7 | [
"Apache-2.0"
] | 1 | 2021-11-11T04:43:09.000Z | 2021-11-11T04:43:09.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.857724 | 80 | 0.715661 |
from six.moves import xrange
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import indexed_slices
from tensorflow.python.framework import ops
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import con... | true | true |
1c33f139de8a7e5d3fbf8f0aabab26f6e70cf9c7 | 65 | py | Python | tests/__init__.py | cthoyt/apicuron-client | f4988dd12437042492e678ac42a4685b147548d2 | [
"MIT"
] | null | null | null | tests/__init__.py | cthoyt/apicuron-client | f4988dd12437042492e678ac42a4685b147548d2 | [
"MIT"
] | null | null | null | tests/__init__.py | cthoyt/apicuron-client | f4988dd12437042492e678ac42a4685b147548d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for :mod:`apicuron_client`."""
| 16.25 | 39 | 0.553846 | true | true | |
1c33f25ddcc7a95fb0d01c4542249e11bbb23454 | 326 | py | Python | Backend/Trackerapp/migrations/0012_remove_customuser_is_verified.py | OscarMugendi/Project-Tracker | f805e706332bb387d9e0f1ed537e91d1360bf2b1 | [
"MIT"
] | null | null | null | Backend/Trackerapp/migrations/0012_remove_customuser_is_verified.py | OscarMugendi/Project-Tracker | f805e706332bb387d9e0f1ed537e91d1360bf2b1 | [
"MIT"
] | null | null | null | Backend/Trackerapp/migrations/0012_remove_customuser_is_verified.py | OscarMugendi/Project-Tracker | f805e706332bb387d9e0f1ed537e91d1360bf2b1 | [
"MIT"
] | null | null | null | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Trackerapp', '0011_merge_0008_auto_20211017_2325_0010_auto_20211019_1133'),
]
operations = [
migrations.RemoveField(
model_name='customuser',
name='is_verified',
),
... | 20.375 | 85 | 0.634969 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Trackerapp', '0011_merge_0008_auto_20211017_2325_0010_auto_20211019_1133'),
]
operations = [
migrations.RemoveField(
model_name='customuser',
name='is_verified',
),
... | true | true |
1c33f2c02c78023d8b92c3824c4be9f5fc7bcb0d | 681 | py | Python | _scripts/docker_compose_run_bash.py | gerold-penz/got-your-back | 614559e411e22b25512932833d429cf831b51c4f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-08T08:12:49.000Z | 2020-05-08T08:12:49.000Z | _scripts/docker_compose_run_bash.py | gerold-penz/got-your-back | 614559e411e22b25512932833d429cf831b51c4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | _scripts/docker_compose_run_bash.py | gerold-penz/got-your-back | 614559e411e22b25512932833d429cf831b51c4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
import os
import sys
import subprocess
THISDIR = os.path.dirname(os.path.realpath(__file__))
DOCKERDIR = os.path.abspath(os.path.join(THISDIR, "..", "docker"))
def main():
print("Docker-Compose RUN\n")
try:
returncode = subprocess.call(
["docker-co... | 20.636364 | 76 | 0.578561 |
import os
import sys
import subprocess
THISDIR = os.path.dirname(os.path.realpath(__file__))
DOCKERDIR = os.path.abspath(os.path.join(THISDIR, "..", "docker"))
def main():
print("Docker-Compose RUN\n")
try:
returncode = subprocess.call(
["docker-compose", "run", "--rm", "got-your-back",... | true | true |
1c33f38502390e02bec734428384c40a1477ab00 | 19,941 | py | Python | source/_UIAHandler.py | asaranprasad/nvda | e9609694acbfb06398eb6552067a0dcd532d67af | [
"bzip2-1.0.6"
] | 1 | 2018-11-16T10:15:59.000Z | 2018-11-16T10:15:59.000Z | source/_UIAHandler.py | asaranprasad/nvda | e9609694acbfb06398eb6552067a0dcd532d67af | [
"bzip2-1.0.6"
] | null | null | null | source/_UIAHandler.py | asaranprasad/nvda | e9609694acbfb06398eb6552067a0dcd532d67af | [
"bzip2-1.0.6"
] | null | null | null | #_UIAHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2011-2018 NV Access Limited, Joseph Lee, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
from ctypes import *
from ctypes.wintypes import *
import comtypes.client
from comtyp... | 46.159722 | 284 | 0.7967 |
from ctypes import *
from ctypes.wintypes import *
import comtypes.client
from comtypes.automation import VT_EMPTY
from comtypes import *
import weakref
import threading
import time
import config
import api
import appModuleHandler
import queueHandler
import controlTypes
import NVDAHelper
import winKerne... | true | true |
1c33f4adf603c76e12800fda43481ab5d8f5e142 | 26,319 | py | Python | ier_model/run_et.py | diegoolano/biomedical_interpretable_entity_representations | 3c35f02ee8dd7ee0f2a23b0014e4b112beab6461 | [
"MIT"
] | 2 | 2021-09-24T08:54:33.000Z | 2021-11-15T05:15:52.000Z | ier_model/run_et.py | diegoolano/biomedical_interpretable_entity_representations | 3c35f02ee8dd7ee0f2a23b0014e4b112beab6461 | [
"MIT"
] | null | null | null | ier_model/run_et.py | diegoolano/biomedical_interpretable_entity_representations | 3c35f02ee8dd7ee0f2a23b0014e4b112beab6461 | [
"MIT"
] | 2 | 2021-07-05T20:19:01.000Z | 2021-08-01T01:01:41.000Z | #!/usr/bin/env python3
import argparse
import gc
import json
import numpy as np
import pickle
import random
import time
import torch
import torch.nn as nn
from tqdm import tqdm
from transformers import AdamW, get_linear_schedule_with_warmup
import transformer_constant
import transformer_data_utils
from transformer_dat... | 38.365889 | 196 | 0.682587 | import argparse
import gc
import json
import numpy as np
import pickle
import random
import time
import torch
import torch.nn as nn
from tqdm import tqdm
from transformers import AdamW, get_linear_schedule_with_warmup
import transformer_constant
import transformer_data_utils
from transformer_data_utils import to_torch... | true | true |
1c33f502aebb10efa0fd15dc2ab7e98b4c9b9f82 | 8,050 | py | Python | support/closure-library/closure/bin/build/closurebuilder.py | joe-greenawalt/skulpt | 1db078e2f6d453403287233254b012bf31960ef4 | [
"MIT"
] | 2 | 2021-01-10T16:19:38.000Z | 2021-06-14T22:09:59.000Z | support/closure-library/closure/bin/build/closurebuilder.py | csev/skulpt | 9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f | [
"MIT"
] | null | null | null | support/closure-library/closure/bin/build/closurebuilder.py | csev/skulpt | 9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f | [
"MIT"
] | 1 | 2015-06-28T18:58:22.000Z | 2015-06-28T18:58:22.000Z | #!/usr/bin/env python
#
# Copyright 2009 The Closure Library Authors. All Rights Reserved.
"""Utility for Closure Library dependency calculation.
ClosureBuilder scans source files to build dependency info. From the
dependencies, the script can produce a deps.js file, a manifest in dependency
order, a concatenated s... | 32.723577 | 79 | 0.623602 |
import logging
import optparse
import os
import sys
import depstree
import jscompiler
import source
import treescan
def _GetOptionsParser():
parser = optparse.OptionParser(__doc__)
parser.add_option('-i',
'--input',
dest='inputs',
action='append'... | true | true |
1c33f61ef94624e19a7f0a90cef13310a305cb70 | 9,181 | py | Python | src/nsvqa/nn/interpreter/batch_base_interpreter.py | drewhayward/DFOL-VQA | 8c7d403bac560588ab3ac45774a3e4f71fbe9c90 | [
"MIT"
] | 23 | 2020-08-17T16:18:33.000Z | 2022-03-09T11:47:37.000Z | src/nsvqa/nn/interpreter/batch_base_interpreter.py | drewhayward/DFOL-VQA | 8c7d403bac560588ab3ac45774a3e4f71fbe9c90 | [
"MIT"
] | 1 | 2021-06-11T15:51:24.000Z | 2021-06-11T15:51:24.000Z | src/nsvqa/nn/interpreter/batch_base_interpreter.py | drewhayward/DFOL-VQA | 8c7d403bac560588ab3ac45774a3e4f71fbe9c90 | [
"MIT"
] | 7 | 2020-11-09T07:25:27.000Z | 2022-01-13T04:25:09.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file
# in the project root for full license information.
import torch
import torch.nn as nn
import os
from operator import itemgetter
from nsvqa.nn.interpreter import util
from nsvqa.nn.interpreter.batch_base_types import... | 49.896739 | 216 | 0.615401 |
import torch
import torch.nn as nn
import os
from operator import itemgetter
from nsvqa.nn.interpreter import util
from nsvqa.nn.interpreter.batch_base_types import BatchWorld, BatchVariableSet, BatchAttentionState
from nsvqa.nn.interpreter.data_parallel import gather_results
class BatchInterpreterBase(nn.Module):
... | true | true |
1c33f62a8d3491e291306562ed3c4d021d62575a | 36,400 | py | Python | tests/test_transforms.py | weecology/albumentations | cc8fbb6e2fcc4f6a4c87a29b6b0784391b0e2db4 | [
"MIT"
] | 1 | 2021-05-22T09:19:31.000Z | 2021-05-22T09:19:31.000Z | tests/test_transforms.py | weecology/albumentations | cc8fbb6e2fcc4f6a4c87a29b6b0784391b0e2db4 | [
"MIT"
] | null | null | null | tests/test_transforms.py | weecology/albumentations | cc8fbb6e2fcc4f6a4c87a29b6b0784391b0e2db4 | [
"MIT"
] | null | null | null | from functools import partial
import cv2
import numpy as np
import pytest
import random
import albumentations as A
import albumentations.augmentations.functional as F
import albumentations.augmentations.geometric.functional as FGeometric
from torchvision.transforms import ColorJitter
from PIL import Image
def set_... | 36.291127 | 119 | 0.607088 | from functools import partial
import cv2
import numpy as np
import pytest
import random
import albumentations as A
import albumentations.augmentations.functional as F
import albumentations.augmentations.geometric.functional as FGeometric
from torchvision.transforms import ColorJitter
from PIL import Image
def set_... | true | true |
1c33f7ec4d42c8baa799ae0b07df4c8afb649cf3 | 12,196 | py | Python | ml-agents-envs/mlagents/envs/brain.py | alexcercos/ML-Agents | c096c36b0348e3673b687499e17891cd35168939 | [
"Apache-2.0"
] | 1 | 2019-12-29T13:40:16.000Z | 2019-12-29T13:40:16.000Z | ml-agents-envs/mlagents/envs/brain.py | alexcercos/ML-Agents | c096c36b0348e3673b687499e17891cd35168939 | [
"Apache-2.0"
] | null | null | null | ml-agents-envs/mlagents/envs/brain.py | alexcercos/ML-Agents | c096c36b0348e3673b687499e17891cd35168939 | [
"Apache-2.0"
] | 2 | 2020-08-16T14:18:16.000Z | 2022-03-18T12:22:54.000Z | import logging
import numpy as np
import io
from mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.timers import hierarchical_timer, timed
from typing import Dict, List, NamedTuple, Optiona... | 38.594937 | 110 | 0.616678 | import logging
import numpy as np
import io
from mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.timers import hierarchical_timer, timed
from typing import Dict, List, NamedTuple, Optiona... | true | true |
1c33f8afcd2c14d682697633b0b5b0150094b3ef | 956 | py | Python | olympicvaxinfo/olympicvaxinfo/urls.py | mueslimak3r/olympicvax | 279bb5eda99d34b20477c613471c1ddcbd9dc968 | [
"MIT"
] | null | null | null | olympicvaxinfo/olympicvaxinfo/urls.py | mueslimak3r/olympicvax | 279bb5eda99d34b20477c613471c1ddcbd9dc968 | [
"MIT"
] | null | null | null | olympicvaxinfo/olympicvaxinfo/urls.py | mueslimak3r/olympicvax | 279bb5eda99d34b20477c613471c1ddcbd9dc968 | [
"MIT"
] | null | null | null | """olympicvaxinfo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 38.24 | 77 | 0.703975 | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('admin/', admin.site.urls),
path("", views.blog_index, name="blog_index"),
path("<int:pk>/", views.blog_detail, name="blog_detail"),
path("<category>/", views.blog_category, name="blog_category"),
] | true | true |
1c33f9078d1d81292a0bc042bd045df08b0b6362 | 12,732 | py | Python | models/faster_rcnn.py | hvkwak/simple-faster-rcnn-pytorch | 3ea84a789c91ea8d403637026b4a5add19e5343a | [
"MIT"
] | null | null | null | models/faster_rcnn.py | hvkwak/simple-faster-rcnn-pytorch | 3ea84a789c91ea8d403637026b4a5add19e5343a | [
"MIT"
] | null | null | null | models/faster_rcnn.py | hvkwak/simple-faster-rcnn-pytorch | 3ea84a789c91ea8d403637026b4a5add19e5343a | [
"MIT"
] | null | null | null | import os
import sys
import torch
import torchvision
import numpy as np
from torch import nn
from torch.nn import functional as F
# from models.utils.nms import non_maximum_suppression
from models.utils.bbox_tools import loc2bbox
from utils.array_tool import tonumpy, totensor
from data.dataset import preprocess
from ut... | 39.175385 | 130 | 0.592366 | import os
import sys
import torch
import torchvision
import numpy as np
from torch import nn
from torch.nn import functional as F
from models.utils.bbox_tools import loc2bbox
from utils.array_tool import tonumpy, totensor
from data.dataset import preprocess
from utils.util import read_image
from utils.config import opt... | true | true |
1c33f9ae72ee75467eb64f9ff3a3a2bc0a89a5fb | 905 | py | Python | interlecture/interauth/migrations/0001_initial.py | afriestad/interlecture | 56d3d086ed6d0fd0de599120d12f88d6d1da2271 | [
"MIT"
] | null | null | null | interlecture/interauth/migrations/0001_initial.py | afriestad/interlecture | 56d3d086ed6d0fd0de599120d12f88d6d1da2271 | [
"MIT"
] | null | null | null | interlecture/interauth/migrations/0001_initial.py | afriestad/interlecture | 56d3d086ed6d0fd0de599120d12f88d6d1da2271 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-25 18:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 31.206897 | 145 | 0.649724 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | true | true |
1c33f9b24d3204ce768b252cf5589524fd7c303b | 1,562 | py | Python | configs/detection/_base_/models/slowonly_r50_nl.py | Naoki-Wake/mmaction2 | a2032605db82509744a18d993c94a06feb1efd15 | [
"Apache-2.0"
] | null | null | null | configs/detection/_base_/models/slowonly_r50_nl.py | Naoki-Wake/mmaction2 | a2032605db82509744a18d993c94a06feb1efd15 | [
"Apache-2.0"
] | null | null | null | configs/detection/_base_/models/slowonly_r50_nl.py | Naoki-Wake/mmaction2 | a2032605db82509744a18d993c94a06feb1efd15 | [
"Apache-2.0"
] | null | null | null | # model setting
model = dict(
type='FastRCNN',
backbone=dict(
type='ResNet3dSlowOnly',
depth=50,
pretrained=None,
pretrained2d=False,
lateral=False,
num_stages=4,
conv1_kernel=(1, 7, 7),
conv1_stride_t=1,
pool1_stride_t=1,
spatial_s... | 30.627451 | 75 | 0.508963 | model = dict(
type='FastRCNN',
backbone=dict(
type='ResNet3dSlowOnly',
depth=50,
pretrained=None,
pretrained2d=False,
lateral=False,
num_stages=4,
conv1_kernel=(1, 7, 7),
conv1_stride_t=1,
pool1_stride_t=1,
spatial_strides=(1, 2, 2,... | true | true |
1c33f9b3da0355f5366dab67a8602e113eeb6c9c | 863 | py | Python | belleflopt/migrations/0030_auto_20200228_2058.py | ucd-cws/eflows_optimization | 2eb9f13a042ab81541488358ad0724555a5d57fc | [
"MIT"
] | 2 | 2020-04-19T04:05:51.000Z | 2021-04-19T02:47:40.000Z | belleflopt/migrations/0030_auto_20200228_2058.py | ucd-cws/eflows_optimization | 2eb9f13a042ab81541488358ad0724555a5d57fc | [
"MIT"
] | 7 | 2019-08-31T05:57:30.000Z | 2019-11-27T23:58:13.000Z | belleflopt/migrations/0030_auto_20200228_2058.py | ucd-cws/eflows_optimization | 2eb9f13a042ab81541488358ad0724555a5d57fc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2020-02-29 04:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('belleflopt', '0029_modelrun_description'),
]
operations = [
migrations.AddField(
model_name='mo... | 28.766667 | 135 | 0.618772 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('belleflopt', '0029_modelrun_description'),
]
operations = [
migrations.AddField(
model_name='modelrun',
name='water_year',
... | true | true |
1c33f9c7f6d84650c468e676ac804f8fae83c447 | 1,200 | py | Python | explorebg/questions/models.py | bvoytash/Quiz-Application | 279a029b8e40513642bf002387f813d680a74ed7 | [
"MIT"
] | null | null | null | explorebg/questions/models.py | bvoytash/Quiz-Application | 279a029b8e40513642bf002387f813d680a74ed7 | [
"MIT"
] | null | null | null | explorebg/questions/models.py | bvoytash/Quiz-Application | 279a029b8e40513642bf002387f813d680a74ed7 | [
"MIT"
] | null | null | null | import random
from django.contrib.auth import get_user_model
from django.db import models
UserModel = get_user_model()
class Question(models.Model):
text = models.CharField(max_length=500)
user = models.ForeignKey(
UserModel,
on_delete=models.CASCADE,
)
def get_answer_quiz(self):
... | 23.076923 | 93 | 0.678333 | import random
from django.contrib.auth import get_user_model
from django.db import models
UserModel = get_user_model()
class Question(models.Model):
text = models.CharField(max_length=500)
user = models.ForeignKey(
UserModel,
on_delete=models.CASCADE,
)
def get_answer_quiz(self):
... | true | true |
1c33f9e9244a342d5f565b8b316868b728c73720 | 74 | py | Python | ast-transformations-core/src/test/resources/org/jetbrains/research/ml/ast/transformations/commentsRemoval/data/out_6.py | JetBrains-Research/ast-transformations | 0ab408af3275b520cc87a473f418c4b4dfcb0284 | [
"MIT"
] | 8 | 2021-01-19T21:15:54.000Z | 2022-02-23T19:16:25.000Z | ast-transformations-core/src/test/resources/org/jetbrains/research/ml/ast/transformations/commentsRemoval/data/out_6.py | JetBrains-Research/ast-transformations | 0ab408af3275b520cc87a473f418c4b4dfcb0284 | [
"MIT"
] | 4 | 2020-11-17T14:28:25.000Z | 2022-02-24T07:54:28.000Z | ast-transformations-core/src/test/resources/org/jetbrains/research/ml/ast/transformations/commentsRemoval/data/out_6.py | nbirillo/ast-transformations | 717706765a2da29087a0de768fc851698886dd65 | [
"MIT"
] | 1 | 2022-02-23T19:16:30.000Z | 2022-02-23T19:16:30.000Z | def main():
b = 5
b = 510
def foo():
pass
a = 5
| 8.222222 | 14 | 0.337838 | def main():
b = 5
b = 510
def foo():
pass
a = 5
| true | true |
1c33f9f8be2a7dfe451fcc83bd92fdf584bcdc77 | 14,611 | py | Python | static/paddlex/tools/x2seg.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 3,655 | 2020-03-28T09:19:50.000Z | 2022-03-31T13:28:39.000Z | static/paddlex/tools/x2seg.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 829 | 2020-03-28T04:03:18.000Z | 2022-03-31T14:34:30.000Z | static/paddlex/tools/x2seg.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 738 | 2020-03-28T03:56:46.000Z | 2022-03-31T13:11:03.000Z | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 42.228324 | 88 | 0.524263 |
import cv2
import uuid
import json
import os
import os.path as osp
import shutil
import numpy as np
import PIL.Image
from .base import MyEncoder, is_pic, get_encoding
import math
class X2Seg(object):
def __init__(self):
self.labels2ids = {'_background_': 0}
def shapes_to_label(self, img_shape, shape... | true | true |
1c33fa15ddbf9c5dfc357e4226f51b2734c6f579 | 738 | py | Python | nodes/List/GetTaskRenderListIndex.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 17 | 2021-11-21T09:26:55.000Z | 2022-03-09T06:56:01.000Z | nodes/List/GetTaskRenderListIndex.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 1 | 2021-12-05T13:02:48.000Z | 2021-12-06T08:02:34.000Z | nodes/List/GetTaskRenderListIndex.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 4 | 2021-11-23T14:49:34.000Z | 2021-12-30T15:04:58.000Z | import bpy
from bpy.props import *
from ...nodes.BASE.node_base import RenderNodeBase
class RenderNodeGetListIndex(RenderNodeBase):
"""A simple input node"""
bl_idname = 'RenderNodeGetListIndex'
bl_label = 'Get List Index'
def init(self, context):
self.create_output('RenderNodeSocketInt', "i... | 26.357143 | 81 | 0.730352 | import bpy
from bpy.props import *
from ...nodes.BASE.node_base import RenderNodeBase
class RenderNodeGetListIndex(RenderNodeBase):
bl_idname = 'RenderNodeGetListIndex'
bl_label = 'Get List Index'
def init(self, context):
self.create_output('RenderNodeSocketInt', "index", 'Index')
def proce... | true | true |
1c33fa1cca0ea17ed709ee6bbe64293dc43fa107 | 10,437 | py | Python | das_decennial/programs/schema/attributes/hhtype.py | p-b-j/uscb-das-container-public | 7f7ba44055da15d13b191180249e656e1bd398c6 | [
"MIT"
] | 1 | 2021-11-13T01:35:31.000Z | 2021-11-13T01:35:31.000Z | das_decennial/programs/schema/attributes/hhtype.py | p-b-j/uscb-das-container-public | 7f7ba44055da15d13b191180249e656e1bd398c6 | [
"MIT"
] | 1 | 2021-10-30T00:48:45.000Z | 2021-11-01T23:33:46.000Z | das_decennial/programs/schema/attributes/hhtype.py | p-b-j/uscb-das-container-public | 7f7ba44055da15d13b191180249e656e1bd398c6 | [
"MIT"
] | null | null | null | from programs.schema.attributes.abstractattribute import AbstractAttribute
from constants import CC
class HHTypeAttr(AbstractAttribute):
@staticmethod
def getName():
return CC.ATTR_HHTYPE
@staticmethod
def getLevels():
return {
'Married opposite-sex with own children unde... | 35.379661 | 107 | 0.562326 | from programs.schema.attributes.abstractattribute import AbstractAttribute
from constants import CC
class HHTypeAttr(AbstractAttribute):
@staticmethod
def getName():
return CC.ATTR_HHTYPE
@staticmethod
def getLevels():
return {
'Married opposite-sex with own children unde... | true | true |
1c33fbacc173c5443bc0886f17a8de69e63f17c2 | 196 | py | Python | example/myapp/models.py | shamanu4/django-fine-uploader | 8b53fdbaa27f749bf103b77d168fdd5e02def4e5 | [
"MIT"
] | null | null | null | example/myapp/models.py | shamanu4/django-fine-uploader | 8b53fdbaa27f749bf103b77d168fdd5e02def4e5 | [
"MIT"
] | null | null | null | example/myapp/models.py | shamanu4/django-fine-uploader | 8b53fdbaa27f749bf103b77d168fdd5e02def4e5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
class FineFile(models.Model):
fine_file = models.FileField()
def __str__(self):
return self.fine_file.name
| 17.818182 | 39 | 0.739796 | from __future__ import unicode_literals
from django.db import models
class FineFile(models.Model):
fine_file = models.FileField()
def __str__(self):
return self.fine_file.name
| true | true |
1c33fc85f24467f19a7d8f96bb4425aba7affc44 | 24,545 | py | Python | src/garage/torch/modules/gaussian_mlp_module.py | waldow90/garage | 1ea04b8b90d2da0d7da10e8604a144018b61b81c | [
"MIT"
] | 1 | 2020-02-19T00:01:29.000Z | 2020-02-19T00:01:29.000Z | src/garage/torch/modules/gaussian_mlp_module.py | Ashutosh-Adhikari/garage | 482a26a07d46091f878c41b582f1478588e397ff | [
"MIT"
] | null | null | null | src/garage/torch/modules/gaussian_mlp_module.py | Ashutosh-Adhikari/garage | 482a26a07d46091f878c41b582f1478588e397ff | [
"MIT"
] | 1 | 2020-02-13T12:05:35.000Z | 2020-02-13T12:05:35.000Z | """GaussianMLPModule."""
import abc
import torch
from torch import nn
from torch.distributions import Normal
from torch.distributions.independent import Independent
from garage.torch.modules.mlp_module import MLPModule
from garage.torch.modules.multi_headed_mlp_module import MultiHeadedMLPModule
class GaussianMLPBa... | 45.369686 | 79 | 0.612508 | import abc
import torch
from torch import nn
from torch.distributions import Normal
from torch.distributions.independent import Independent
from garage.torch.modules.mlp_module import MLPModule
from garage.torch.modules.multi_headed_mlp_module import MultiHeadedMLPModule
class GaussianMLPBaseModule(nn.Module):
... | true | true |
1c33fcc9c8a2484f4594c3812636622d2fa80cda | 4,296 | py | Python | lm_eval/tasks/pile.py | ucinlp/lm-evaluation-harness | 52bb90e2a161dc7c5d93478406c4cfe489caf2b2 | [
"MIT"
] | null | null | null | lm_eval/tasks/pile.py | ucinlp/lm-evaluation-harness | 52bb90e2a161dc7c5d93478406c4cfe489caf2b2 | [
"MIT"
] | null | null | null | lm_eval/tasks/pile.py | ucinlp/lm-evaluation-harness | 52bb90e2a161dc7c5d93478406c4cfe489caf2b2 | [
"MIT"
] | null | null | null | """
The Pile: An 800GB Dataset of Diverse Text for Language Modeling
https://arxiv.org/pdf/2101.00027.pdf
The Pile is a 825 GiB diverse, open source language modelling data set that consists
of 22 smaller, high-quality datasets combined together. To score well on Pile
BPB (bits per byte), a model must be able to under... | 27.896104 | 221 | 0.744646 | import os
import lm_dataformat
import abc
import numpy as np
from lm_eval.base import rf, PerplexityTask
from ..metrics import mean, matthews_corrcoef, f1_score
from ..utils import general_detokenize
from best_download import download_file
_CITATION = """
@article{pile,
title={The {P}ile: An 800GB Dataset of Diver... | true | true |
1c33fd7758a8b0634c999edfd18b304199a911dc | 75,657 | py | Python | sdk/python/pulumi_azure_native/compute/v20200930/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/compute/v20200930/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/compute/v20200930/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.95829 | 335 | 0.657718 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
__all__ = [
'CreationDataResponse',
'DataDiskImageEncryptionResponse',
'DisallowedResponse',
'DiskSkuResponse',... | true | true |
1c33fdb7cffa7a94b8db97932f625aeac2f2911b | 4,987 | py | Python | helper_nodes/display_poses.py | apl-ocean-engineering/visual_odom | 6e88c8d5a098585f7b12e4934f47494414824b4d | [
"MIT"
] | 1 | 2020-11-22T20:09:53.000Z | 2020-11-22T20:09:53.000Z | helper_nodes/display_poses.py | apl-ocean-engineering/stereo_visual_odom | 6e88c8d5a098585f7b12e4934f47494414824b4d | [
"MIT"
] | null | null | null | helper_nodes/display_poses.py | apl-ocean-engineering/stereo_visual_odom | 6e88c8d5a098585f7b12e4934f47494414824b4d | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import copy
import numpy as np
import argparse
def get_eucld_error(x1, x2, y1, y2, z1, z2):
error = []
for i in range(len(x1)):
p1 = np.array([x1[i], y1[i], z1[i]])
p2 = np.array([x2[i], y2[i], z2[i]])
error.append(float(np.sum(np.subtract(p1, p2))))
... | 28.175141 | 76 | 0.548626 | import matplotlib.pyplot as plt
import copy
import numpy as np
import argparse
def get_eucld_error(x1, x2, y1, y2, z1, z2):
error = []
for i in range(len(x1)):
p1 = np.array([x1[i], y1[i], z1[i]])
p2 = np.array([x2[i], y2[i], z2[i]])
error.append(float(np.sum(np.subtract(p1, p2))))
... | true | true |
1c33fdc9d99aa7d333404785340880afd23b60d3 | 3,678 | py | Python | models/plain_lstm.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | 3 | 2019-05-30T03:40:38.000Z | 2021-04-12T06:50:41.000Z | models/plain_lstm.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | 1 | 2020-06-15T12:27:56.000Z | 2020-06-15T12:27:56.000Z | models/plain_lstm.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | null | null | null | import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class PlainLSTM(nn.Module):
"""PlainLSTM """
def __init__(self, vocab_size, emb_dim, hidden_dim, use_cuda=False):
super(PlainLSTM, self).__init__()
... | 32.263158 | 104 | 0.54894 | import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class PlainLSTM(nn.Module):
def __init__(self, vocab_size, emb_dim, hidden_dim, use_cuda=False):
super(PlainLSTM, self).__init__()
self.vocab_size = voc... | true | true |
1c33fe2b2b38a27cad60e2b1413c587bdf493fa1 | 317 | py | Python | venv/Lib/site-packages/nipype/interfaces/minc/testdata.py | richung99/digitizePlots | 6b408c820660a415a289726e3223e8f558d3e18b | [
"MIT"
] | 585 | 2015-01-12T16:06:47.000Z | 2022-03-26T14:51:08.000Z | nipype/interfaces/minc/testdata.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 2,329 | 2015-01-01T09:56:41.000Z | 2022-03-30T14:24:49.000Z | nipype/interfaces/minc/testdata.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 487 | 2015-01-20T01:04:52.000Z | 2022-03-21T21:22:47.000Z | # -*- coding: utf-8 -*-
import os
from ...testing import example_data
minc2Dfile = example_data("minc_test_2D_00.mnc")
minc3Dfile = example_data("minc_test_3D_00.mnc")
nlp_config = example_data("minc_nlp.conf")
def nonempty_minc_data(i, shape="2D"):
return example_data("minc_test_%s_%.2d.mnc" % (shape, i))
| 22.642857 | 61 | 0.728707 |
import os
from ...testing import example_data
minc2Dfile = example_data("minc_test_2D_00.mnc")
minc3Dfile = example_data("minc_test_3D_00.mnc")
nlp_config = example_data("minc_nlp.conf")
def nonempty_minc_data(i, shape="2D"):
return example_data("minc_test_%s_%.2d.mnc" % (shape, i))
| true | true |
1c33fe6b373149f67b58af2338d67477648d458f | 6,134 | py | Python | server_normal_Flask_beautiful/routes/routes_user.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 7 | 2018-02-24T13:41:21.000Z | 2022-02-06T04:59:13.000Z | server_normal_Flask_beautiful/routes/routes_user.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 6 | 2018-02-25T11:50:42.000Z | 2021-12-13T19:55:13.000Z | server_normal_Flask_beautiful/routes/routes_user.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 1 | 2018-03-01T02:43:15.000Z | 2018-03-01T02:43:15.000Z | from utils import log
from config import gg, image_file_dir
from routes import (
current_user,
login_required,
)
from flask import (
request,
Blueprint,
render_template,
redirect,
url_for,
session,
make_response,
send_from_directory,
abort,
flash,
)
from models.user imp... | 27.141593 | 152 | 0.662048 | from utils import log
from config import gg, image_file_dir
from routes import (
current_user,
login_required,
)
from flask import (
request,
Blueprint,
render_template,
redirect,
url_for,
session,
make_response,
send_from_directory,
abort,
flash,
)
from models.user imp... | true | true |
1c33ff10010a98d8a99a1b158c70877e9d59678f | 997 | py | Python | setup.py | brandonvfx/flask-lambda | 29bb0d728037af076019cfbe398e084cd58821bb | [
"Apache-2.0"
] | 6 | 2018-10-16T13:34:26.000Z | 2020-06-15T22:20:15.000Z | setup.py | brandonvfx/flask-lambda | 29bb0d728037af076019cfbe398e084cd58821bb | [
"Apache-2.0"
] | 2 | 2019-07-08T09:22:25.000Z | 2020-12-16T12:47:22.000Z | setup.py | brandonvfx/flask-lambda | 29bb0d728037af076019cfbe398e084cd58821bb | [
"Apache-2.0"
] | 5 | 2018-12-20T14:07:14.000Z | 2021-05-15T02:14:29.000Z | from setuptools import setup, find_packages
with open('README.rst') as f:
long_description = f.read()
setup(
name='flask-lambda-support',
version='0.1.5',
description='Python 3.6+ module to make Flask compatible with AWS Lambda',
long_description=long_description,
keywords='flask aws amazon l... | 32.16129 | 78 | 0.652959 | from setuptools import setup, find_packages
with open('README.rst') as f:
long_description = f.read()
setup(
name='flask-lambda-support',
version='0.1.5',
description='Python 3.6+ module to make Flask compatible with AWS Lambda',
long_description=long_description,
keywords='flask aws amazon l... | true | true |
1c33ff237e9a5bed9d42985f51dcd2d5a656d2e9 | 174 | py | Python | Unit 2/2.8/2.8.4 Beaded Bracelet.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | 1 | 2021-04-08T14:02:49.000Z | 2021-04-08T14:02:49.000Z | Unit 2/2.8/2.8.4 Beaded Bracelet.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | null | null | null | Unit 2/2.8/2.8.4 Beaded Bracelet.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | null | null | null | speed(0)
def make_bead():
forward(100)
pendown()
circle(10)
penup()
backward(100)
penup()
for i in range(36):
make_bead()
left(10)
| 12.428571 | 20 | 0.528736 | speed(0)
def make_bead():
forward(100)
pendown()
circle(10)
penup()
backward(100)
penup()
for i in range(36):
make_bead()
left(10)
| true | true |
1c33ffe24ec1e81536cab928d5fd3f8679749726 | 6,856 | py | Python | cardea/fhir/Media.py | sarahmish/Cardea | 85c4246c12178e6d1b9cc12eb39c264f3c20f3e9 | [
"MIT"
] | 69 | 2021-01-28T22:25:10.000Z | 2022-03-15T00:23:33.000Z | cardea/fhir/Media.py | sarahmish/Cardea | 85c4246c12178e6d1b9cc12eb39c264f3c20f3e9 | [
"MIT"
] | 30 | 2018-08-29T12:45:23.000Z | 2019-12-24T11:08:12.000Z | cardea/fhir/Media.py | sarahmish/Cardea | 85c4246c12178e6d1b9cc12eb39c264f3c20f3e9 | [
"MIT"
] | 14 | 2021-03-24T01:21:25.000Z | 2022-03-12T11:53:40.000Z | from .fhirbase import fhirbase
class Media(fhirbase):
"""
A photo, video, or audio recording acquired or used in healthcare. The
actual content may be inline or provided by direct reference.
Args:
resourceType: This is a Media resource
identifier: Identifiers associated with the image... | 34.109453 | 86 | 0.575117 | from .fhirbase import fhirbase
class Media(fhirbase):
__name__ = 'Media'
def __init__(self, dict_values=None):
self.resourceType = 'Media'
self.basedOn = None
self.type = None
self.subtype = None
self.view = ... | true | true |
1c340161e4b6f7a3fc08face097e2d2cd16fb14c | 735 | py | Python | chap03/author-manager/src/api/config/config.py | matadorchw/rest_flask | b5b643d72e63e654f2d893621158e2e5db870b15 | [
"MIT"
] | 2 | 2020-10-21T14:04:42.000Z | 2020-10-21T14:05:01.000Z | chap03/author-manager/src/api/config/config.py | matadorchw/rest_flask | b5b643d72e63e654f2d893621158e2e5db870b15 | [
"MIT"
] | null | null | null | chap03/author-manager/src/api/config/config.py | matadorchw/rest_flask | b5b643d72e63e654f2d893621158e2e5db870b15 | [
"MIT"
] | null | null | null | class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = ''
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost:3306/flaskrest'
SECRET_KE... | 22.96875 | 84 | 0.706122 | class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = ''
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost:3306/flaskrest'
SECRET_KE... | true | true |
1c3402eecc1efe7833e69b853785cb075e895c8e | 132 | py | Python | blogmods/models/__init__.py | stonescar/multi-user-blog | a402dafde1f7d94031129638aa072ce39223e80e | [
"MIT"
] | null | null | null | blogmods/models/__init__.py | stonescar/multi-user-blog | a402dafde1f7d94031129638aa072ce39223e80e | [
"MIT"
] | null | null | null | blogmods/models/__init__.py | stonescar/multi-user-blog | a402dafde1f7d94031129638aa072ce39223e80e | [
"MIT"
] | null | null | null | from database import Database
from users import Users
from posts import Posts
from comments import Comments
from votes import Votes
| 22 | 29 | 0.848485 | from database import Database
from users import Users
from posts import Posts
from comments import Comments
from votes import Votes
| true | true |
1c3404f181a064281760dfa67f303c16422cd5c3 | 529 | py | Python | commands/upgrader/commands/blockdata.py | Red-Teapot/mc-commandblock-1.13-update | 64106e1ecb5adca2aff1eeb3a1fcc11486940000 | [
"MIT"
] | 1 | 2020-07-27T16:53:26.000Z | 2020-07-27T16:53:26.000Z | commands/upgrader/commands/blockdata.py | Red-Teapot/mc-commandblock-1.13-update | 64106e1ecb5adca2aff1eeb3a1fcc11486940000 | [
"MIT"
] | 5 | 2019-01-02T14:21:32.000Z | 2019-07-07T05:39:39.000Z | commands/upgrader/commands/blockdata.py | Red-Teapot/mc-commandblock-1.13-update | 64106e1ecb5adca2aff1eeb3a1fcc11486940000 | [
"MIT"
] | null | null | null | from commands.pre_1_13.cmdex import CMDEx
from commands.upgrader.utils import command_upgrader_base
CMDEXS = [
CMDEx('blockdata {coordinate:x} {coordinate:y} {coordinate:z} {nbtstr:nbt}'),
]
def __upgrade(order, props):
result = 'data merge block '
result += str(props['x']) + ' ' + str(props['y']) + ' '... | 26.45 | 83 | 0.669187 | from commands.pre_1_13.cmdex import CMDEx
from commands.upgrader.utils import command_upgrader_base
CMDEXS = [
CMDEx('blockdata {coordinate:x} {coordinate:y} {coordinate:z} {nbtstr:nbt}'),
]
def __upgrade(order, props):
result = 'data merge block '
result += str(props['x']) + ' ' + str(props['y']) + ' '... | true | true |
1c3404f28196271ef1b09445916e0d69195037e1 | 16,628 | py | Python | utils.py | creol-io/machine-manager | 01108f0c26c15f515c1d9d3361f1c1a27c03d8ab | [
"Apache-2.0"
] | null | null | null | utils.py | creol-io/machine-manager | 01108f0c26c15f515c1d9d3361f1c1a27c03d8ab | [
"Apache-2.0"
] | null | null | null | utils.py | creol-io/machine-manager | 01108f0c26c15f515c1d9d3361f1c1a27c03d8ab | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 Cartesi Pte. Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software d... | 45.062331 | 172 | 0.674886 |
import subprocess
import logging
import logging.config
import logging.handlers
import traceback
import grpc
import json
import time
import os
import cartesi_machine_pb2_grpc
import cartesi_machine_pb2
import machine_manager_pb2
LOG_FILENAME = "manager.log"
RUN_CYCLES_BATCH_SIZE = 10**7
UNIX = "unix"
TCP = "tcp"
SO... | true | true |
1c34061109ca350266eae9e1a19f7c8cd8d30559 | 150 | py | Python | terrascript/resource/dnsimple.py | amlodzianowski/python-terrascript | 1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49 | [
"BSD-2-Clause"
] | null | null | null | terrascript/resource/dnsimple.py | amlodzianowski/python-terrascript | 1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49 | [
"BSD-2-Clause"
] | null | null | null | terrascript/resource/dnsimple.py | amlodzianowski/python-terrascript | 1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49 | [
"BSD-2-Clause"
] | null | null | null | # terrascript/resource/dnsimple.py
import terrascript
class dnsimple_record(terrascript.Resource):
pass
__all__ = [
"dnsimple_record",
]
| 11.538462 | 44 | 0.74 |
import terrascript
class dnsimple_record(terrascript.Resource):
pass
__all__ = [
"dnsimple_record",
]
| true | true |
1c34064210bf3bb84e61b0d3413700caef45e132 | 2,375 | py | Python | app/kaznlplib/tokenization/tokhmm.py | n1EzeR/reviews_tazalau | 973b0a8ad1c4f54ad13e767424cf3d42fb1a0bbf | [
"CC0-1.0"
] | null | null | null | app/kaznlplib/tokenization/tokhmm.py | n1EzeR/reviews_tazalau | 973b0a8ad1c4f54ad13e767424cf3d42fb1a0bbf | [
"CC0-1.0"
] | 1 | 2021-06-02T00:47:32.000Z | 2021-06-02T00:47:32.000Z | app/kaznlplib/tokenization/tokhmm.py | n1EzeR/reviews_tazalau | 973b0a8ad1c4f54ad13e767424cf3d42fb1a0bbf | [
"CC0-1.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import re
from kaznlp.models.hmm import HMM_DI
# character processing regex with replacements
CPREX = {
# uppercase mathcer and replacer
re.compile(u"[A-ZА-ЯЁӘІҢҒҮҰҚӨҺ]", re.U): "CAP",
# lowercase mathcer and replacer
re.compile(u"[a-zа-яёәіңғүұқөһ]", re.U): "LOW",
# sente... | 32.534247 | 77 | 0.507368 |
import re
from kaznlp.models.hmm import HMM_DI
CPREX = {
re.compile(u"[A-ZА-ЯЁӘІҢҒҮҰҚӨҺ]", re.U): "CAP",
re.compile(u"[a-zа-яёәіңғүұқөһ]", re.U): "LOW",
re.compile(u"[\.\?\!]", re.U): "SFL",
re.compile(u"\s", re.U): "SPC",
re.compile(u"\d", re.U): "DIG",
}
class TokenizerHMM... | true | true |
1c34065aa7e70f2a9d46f68e522f48e8db1adb12 | 25,852 | py | Python | userbot/modules/scrapers.py | Saksham033/PaperplaneExtended | 1480e25bcd2e012ba1e2d78c1ba29a3cbc449a23 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/scrapers.py | Saksham033/PaperplaneExtended | 1480e25bcd2e012ba1e2d78c1ba29a3cbc449a23 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/scrapers.py | Saksham033/PaperplaneExtended | 1480e25bcd2e012ba1e2d78c1ba29a3cbc449a23 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing various scrapers. """
import os
import time
import asyncio
import shutil
from bs4 import... | 35.268759 | 152 | 0.572567 |
import os
import time
import asyncio
import shutil
from bs4 import BeautifulSoup
import re
from time import sleep
from html import unescape
from re import findall
from selenium import webdriver
from urllib.parse import quote_plus
from urllib.error import HTTPError
from selenium.webdriver.support.ui import Select
from ... | true | true |
1c34067ecf84e3d35f17b9865cf821ee9efe0073 | 7,473 | py | Python | account/tests/test_password.py | AHDCreative/django_user_accounts | 5ab37c5298123189a29fb4c7048ea6a69e2509ff | [
"MIT"
] | null | null | null | account/tests/test_password.py | AHDCreative/django_user_accounts | 5ab37c5298123189a29fb4c7048ea6a69e2509ff | [
"MIT"
] | null | null | null | account/tests/test_password.py | AHDCreative/django_user_accounts | 5ab37c5298123189a29fb4c7048ea6a69e2509ff | [
"MIT"
] | null | null | null | import datetime
import django
from django.contrib.auth.hashers import check_password, make_password
from django.contrib.auth.models import User
from django.test import TestCase, modify_settings, override_settings
import pytz
from account.compat import reverse
from account.models import PasswordExpiry, PasswordHistory
f... | 34.597222 | 124 | 0.63977 | import datetime
import django
from django.contrib.auth.hashers import check_password, make_password
from django.contrib.auth.models import User
from django.test import TestCase, modify_settings, override_settings
import pytz
from account.compat import reverse
from account.models import PasswordExpiry, PasswordHistory
f... | true | true |
1c3406c0154dcae2ad9030f6a2382d96e6ce407b | 13,130 | py | Python | extra_foam/special_suite/tests/test_gotthard.py | ebadkamil/EXtra-foam | 8e58143040c788dc70ea98ea5adc1fb63b7cfe0d | [
"BSD-3-Clause"
] | 7 | 2019-11-27T09:31:37.000Z | 2022-02-12T21:28:49.000Z | extra_foam/special_suite/tests/test_gotthard.py | ebadkamil/EXtra-foam | 8e58143040c788dc70ea98ea5adc1fb63b7cfe0d | [
"BSD-3-Clause"
] | 172 | 2019-12-03T07:56:02.000Z | 2022-03-25T15:46:45.000Z | extra_foam/special_suite/tests/test_gotthard.py | ebadkamil/EXtra-foam | 8e58143040c788dc70ea98ea5adc1fb63b7cfe0d | [
"BSD-3-Clause"
] | 9 | 2019-11-27T09:32:38.000Z | 2022-01-05T09:56:10.000Z | import unittest
from unittest.mock import MagicMock, patch, PropertyMock
from collections import Counter
import pytest
import numpy as np
from xarray import DataArray
from PyQt5.QtCore import Qt
from PyQt5.QtTest import QSignalSpy, QTest
from extra_foam.pipeline.tests import _RawDataMixin
from extra_foam.special_su... | 37.947977 | 104 | 0.651942 | import unittest
from unittest.mock import MagicMock, patch, PropertyMock
from collections import Counter
import pytest
import numpy as np
from xarray import DataArray
from PyQt5.QtCore import Qt
from PyQt5.QtTest import QSignalSpy, QTest
from extra_foam.pipeline.tests import _RawDataMixin
from extra_foam.special_su... | true | true |
1c3406df759000e6ee4b53c4ee71e09130029fa6 | 3,304 | py | Python | openstack/network/v2/certificate.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/network/v2/certificate.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/network/v2/certificate.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 39.807229 | 109 | 0.681901 |
from openstack.network import network_service
from openstack import resource2
class Certificate(resource2.Resource):
resource_key = 'certificate'
resources_key = 'certificates'
base_path = '/lbaas/certificates'
service = network_service.NetworkService()
allow_create = True
allow_get = True
... | true | true |
1c3407eb73e0eefc84b416e84e029f9171d5bc7d | 1,522 | py | Python | bioinformatics_stronghold/tests/test_revc.py | nathaliagg/my_rosalind_answers | f5c95c63051360a34e2b599648d4d57cbaf693a8 | [
"MIT"
] | null | null | null | bioinformatics_stronghold/tests/test_revc.py | nathaliagg/my_rosalind_answers | f5c95c63051360a34e2b599648d4d57cbaf693a8 | [
"MIT"
] | null | null | null | bioinformatics_stronghold/tests/test_revc.py | nathaliagg/my_rosalind_answers | f5c95c63051360a34e2b599648d4d57cbaf693a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""tests for revc .py"""
import os
import re
from subprocess import getstatusoutput
prg = '../revc.py'
good_input = 'test_data/good_input_revc.txt'
bad_input = 'test_data/bad_input_revc.txt'
good_output = 'ACCGGGTTTT'
# --------------------------------------------------
def test_exists():
... | 24.15873 | 64 | 0.508541 |
import os
import re
from subprocess import getstatusoutput
prg = '../revc.py'
good_input = 'test_data/good_input_revc.txt'
bad_input = 'test_data/bad_input_revc.txt'
good_output = 'ACCGGGTTTT'
def test_exists():
assert os.path.isfile(prg)
def test_usage():
for flag in ['-h', '--help']:
rv, out... | true | true |
1c3407ecd357dfc5ca2a544cbb74615755d2699b | 1,696 | py | Python | src/study/config.py | ppmzhang2/gpt3-study | 1c4e34238301e06da8cbda23eb4e473567e15c80 | [
"MIT"
] | null | null | null | src/study/config.py | ppmzhang2/gpt3-study | 1c4e34238301e06da8cbda23eb4e473567e15c80 | [
"MIT"
] | null | null | null | src/study/config.py | ppmzhang2/gpt3-study | 1c4e34238301e06da8cbda23eb4e473567e15c80 | [
"MIT"
] | null | null | null | """project config"""
import os
import sys
from logging.config import dictConfig
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
# pylint: disable=too-few-public-methods
"""default config"""
# token
OPENAI_KEY = os.getenv("OPENAI_KEY", "")
# logging
LOG_LEVEL = "WARNING"
... | 29.241379 | 79 | 0.524175 | import os
import sys
from logging.config import dictConfig
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
OPENAI_KEY = os.getenv("OPENAI_KEY", "")
LOG_LEVEL = "WARNING"
LOG_LINE_FORMAT = "%(asctime)s %(levelname)-5s %(threadName)s: %(message)s"
LOG_DATETIME_FORMAT = "... | true | true |
1c340895d8ff7e0e155b6637d09d7adf5472fe3b | 8,420 | py | Python | notes/mainwithfacade.py | yeezysmem/notes.io | 9ca7c2251f0fc4e38b6f50e0f0411ebf5ee132da | [
"MIT"
] | 1 | 2020-12-02T14:31:02.000Z | 2020-12-02T14:31:02.000Z | notes/mainwithfacade.py | yeezysmem/notes.io | 9ca7c2251f0fc4e38b6f50e0f0411ebf5ee132da | [
"MIT"
] | null | null | null | notes/mainwithfacade.py | yeezysmem/notes.io | 9ca7c2251f0fc4e38b6f50e0f0411ebf5ee132da | [
"MIT"
] | null | null | null | import time
from prettytable import PrettyTable
# from PIL import Image
import tkinter as t
from tkinter.filedialog import askopenfilename
import webbrowser
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
engine = create_engine('sqlite:///DataBaseForNotes.db' , echo=False)
fro... | 23.852691 | 68 | 0.610095 | import time
from prettytable import PrettyTable
import tkinter as t
from tkinter.filedialog import askopenfilename
import webbrowser
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
engine = create_engine('sqlite:///DataBaseForNotes.db' , echo=False)
from sqlalchemy import Colu... | true | true |
1c340923dc4ec14bb7428534234c2587080e5110 | 7,169 | py | Python | src/read_actual_data.py | gdalle/PartiallyObservedVectorAutoRegressions | 28c9d34d7b6e45679e442721daf4946867fd5fb0 | [
"MIT"
] | null | null | null | src/read_actual_data.py | gdalle/PartiallyObservedVectorAutoRegressions | 28c9d34d7b6e45679e442721daf4946867fd5fb0 | [
"MIT"
] | null | null | null | src/read_actual_data.py | gdalle/PartiallyObservedVectorAutoRegressions | 28c9d34d7b6e45679e442721daf4946867fd5fb0 | [
"MIT"
] | null | null | null | import itertools
import os
import zipfile
from joblib import Parallel, delayed
import pandas as pd
from tqdm.notebook import tqdm
# Constants
YEARS = ["2018", "2019", "2020", "2021"]
MONTHS = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
DATA_COLUMNS = {
"BETRIEBSTAG": ("date", "string... | 35.490099 | 88 | 0.600921 | import itertools
import os
import zipfile
from joblib import Parallel, delayed
import pandas as pd
from tqdm.notebook import tqdm
YEARS = ["2018", "2019", "2020", "2021"]
MONTHS = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
DATA_COLUMNS = {
"BETRIEBSTAG": ("date", "string"),
"FAH... | true | true |
1c340959bfcf319ad547abc637ac8cd4909c2e99 | 667 | py | Python | LeetCode/347 Top K Frequent Elements.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/347 Top K Frequent Elements.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/347 Top K Frequent Elements.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | # Hash Table; Heap
# Given a non-empty array of integers, return the k most frequent elements.
#
# Example 1:
#
# Input: nums = [1,1,1,2,2,3], k = 2
# Output: [1,2]
# Example 2:
#
# Input: nums = [1], k = 1
# Output: [1]
# Note:
#
# You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
# Your algorithm'... | 25.653846 | 95 | 0.610195 |
class Solution:
def topKFrequent(self, nums, k):
numsDictKCommon = collections.Counter(nums).most_common(k)
return [x[0] for x in numsDictKCommon]
| true | true |
1c3409b40d34943b071152c0968e0e9175ed142c | 405 | py | Python | exproject/cli.py | yatin-darbar/exproject | 5cac45a28dc71d83215dabe33211dd758b83191a | [
"MIT"
] | null | null | null | exproject/cli.py | yatin-darbar/exproject | 5cac45a28dc71d83215dabe33211dd758b83191a | [
"MIT"
] | null | null | null | exproject/cli.py | yatin-darbar/exproject | 5cac45a28dc71d83215dabe33211dd758b83191a | [
"MIT"
] | null | null | null | """Console script for exproject."""
import sys
import click
@click.command()
def main(args=None):
"""Console script for exproject."""
click.echo("Replace this message by putting your code into "
"exproject.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/"... | 23.823529 | 79 | 0.666667 | import sys
import click
@click.command()
def main(args=None):
click.echo("Replace this message by putting your code into "
"exproject.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/")
return 0
if __name__ == "__main__":
sys.exit(main()) | true | true |
1c3409fa0f2cac32d7f09305197d2875ed50d8f8 | 1,325 | py | Python | aiotdlib/api/functions/request_qr_code_authentication.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 37 | 2021-05-04T10:41:41.000Z | 2022-03-30T13:48:05.000Z | aiotdlib/api/functions/request_qr_code_authentication.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 13 | 2021-07-17T19:54:51.000Z | 2022-02-26T06:50:00.000Z | aiotdlib/api/functions/request_qr_code_authentication.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 7 | 2021-09-22T21:27:11.000Z | 2022-02-20T02:33:19.000Z | # =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | 47.321429 | 356 | 0.578113 | from __future__ import annotations
from pydantic import Field
from ..base_object import BaseObject
class RequestQrCodeAuthentication(BaseObject):
ID: str = Field("requestQrCodeAuthentication", alias="@type")
other_user_ids: list[int]
@staticmethod
def read(q: dict) -> RequestQrCodeAuthentication:
... | true | true |
1c340a57c3769de9448e4dae1c6352d7f424212f | 15,644 | py | Python | PaddleCV/PaddleGAN/trainer/Pix2pix.py | heavengate/models | f05c910f8a8e3105de8c2f1d81e83ca00d2c7ec7 | [
"Apache-2.0"
] | 2 | 2021-06-11T06:48:20.000Z | 2021-09-02T10:23:07.000Z | PaddleCV/PaddleGAN/trainer/Pix2pix.py | heavengate/models | f05c910f8a8e3105de8c2f1d81e83ca00d2c7ec7 | [
"Apache-2.0"
] | null | null | null | PaddleCV/PaddleGAN/trainer/Pix2pix.py | heavengate/models | f05c910f8a8e3105de8c2f1d81e83ca00d2c7ec7 | [
"Apache-2.0"
] | 1 | 2019-08-27T11:19:09.000Z | 2019-08-27T11:19:09.000Z | #copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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 l... | 43.576602 | 116 | 0.510483 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from network.Pix2pix_network import Pix2pix_model
from util import utility
import paddle.fluid as fluid
from paddle.fluid import profiler
import sys
import time
import numpy as np
class GTrainer():
def __... | true | true |
1c340a6352846a6f94a05e23657cc0dadbe2b9f6 | 24,811 | py | Python | test/functional/feature_csv_activation.py | Dollar-coin/Dollar | 4b84e5d14408f3985d527aaccac21472b47c91d5 | [
"MIT"
] | 1 | 2021-02-06T22:18:29.000Z | 2021-02-06T22:18:29.000Z | test/functional/feature_csv_activation.py | Dollar-coin/Dollar | 4b84e5d14408f3985d527aaccac21472b47c91d5 | [
"MIT"
] | 1 | 2021-02-07T00:57:29.000Z | 2021-02-07T10:22:29.000Z | test/functional/feature_csv_activation.py | Dollar-coin/Dollar | 4b84e5d14408f3985d527aaccac21472b47c91d5 | [
"MIT"
] | 1 | 2021-02-26T22:29:45.000Z | 2021-02-26T22:29:45.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test activation of the first version bits soft fork.
This soft fork will activate the following BIPS:
... | 51.05144 | 169 | 0.696506 | from decimal import Decimal
from itertools import product
from io import BytesIO
import time
from test_framework.blocktools import create_coinbase, create_block, create_transaction
from test_framework.messages import ToHex, CTransaction
from test_framework.mininode import P2PDataStore
from test_framework.script import... | true | true |
1c340b1f2cbd9486c82f411e8186992ec5ca287f | 3,885 | py | Python | edb/edgeql/compiler/options.py | sfermigier/edgedb | 13aff7004aa682777287157dea52642c374967e8 | [
"Apache-2.0"
] | 7,302 | 2018-05-10T18:36:31.000Z | 2022-03-31T17:49:36.000Z | edb/edgeql/compiler/options.py | sfermigier/edgedb | 13aff7004aa682777287157dea52642c374967e8 | [
"Apache-2.0"
] | 1,602 | 2018-05-10T17:45:38.000Z | 2022-03-31T23:46:19.000Z | edb/edgeql/compiler/options.py | sfermigier/edgedb | 13aff7004aa682777287157dea52642c374967e8 | [
"Apache-2.0"
] | 236 | 2018-05-13T14:15:29.000Z | 2022-03-29T19:39:19.000Z | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | 34.380531 | 79 | 0.732046 |
from __future__ import annotations
from typing import *
from dataclasses import dataclass, field as dc_field
if TYPE_CHECKING:
from edb.schema import functions as s_func
from edb.schema import objects as s_obj
from edb.schema import name as s_name
from edb.schema import types as s_types
from e... | true | true |
1c340c823663b0eb355585b2deb48e95a2779621 | 182 | py | Python | pyretri/models/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 1,063 | 2020-04-21T12:42:05.000Z | 2022-03-31T06:32:50.000Z | pyretri/models/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 39 | 2020-05-07T07:24:19.000Z | 2022-02-02T23:49:23.000Z | pyretri/models/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 174 | 2020-04-26T04:33:11.000Z | 2022-03-17T02:58:45.000Z | # -*- coding: utf-8 -*-
from yacs.config import CfgNode
from .config import get_model_cfg
from .builder import build_model
__all__ = [
'get_model_cfg',
'build_model',
]
| 13 | 33 | 0.686813 |
from yacs.config import CfgNode
from .config import get_model_cfg
from .builder import build_model
__all__ = [
'get_model_cfg',
'build_model',
]
| true | true |
1c340cac809b176c6009ba616e4eda9d096d8527 | 722 | py | Python | nazgul/messages/google_chat.py | avara1986/nazgul | 21e32262acac2acda0232c3eb71b8aaa292e63b5 | [
"Apache-2.0"
] | 1 | 2019-06-17T20:28:24.000Z | 2019-06-17T20:28:24.000Z | nazgul/messages/google_chat.py | avara1986/nazgul | 21e32262acac2acda0232c3eb71b8aaa292e63b5 | [
"Apache-2.0"
] | null | null | null | nazgul/messages/google_chat.py | avara1986/nazgul | 21e32262acac2acda0232c3eb71b8aaa292e63b5 | [
"Apache-2.0"
] | null | null | null | from nazgul.message import DriverMessage
from nazgul.response import GoogleChatResponse
class Message(DriverMessage):
response = GoogleChatResponse
use_ids = True
def set_values(self):
self.user_id = self.msg["user"]["name"]
self.user_name = self.users.get(self.user_id, {}).get("name", Fa... | 34.380952 | 96 | 0.641274 | from nazgul.message import DriverMessage
from nazgul.response import GoogleChatResponse
class Message(DriverMessage):
response = GoogleChatResponse
use_ids = True
def set_values(self):
self.user_id = self.msg["user"]["name"]
self.user_name = self.users.get(self.user_id, {}).get("name", Fa... | true | true |
1c340da185a24d00ef78622ff2aacf41ea532c61 | 4,453 | py | Python | tools/face/__make_cs6_split_annot.py | AruniRC/detectron-self-train | a5d0edc51aeab92b953948ef2401294e87efb719 | [
"MIT"
] | 128 | 2019-04-12T17:06:27.000Z | 2022-02-26T10:24:43.000Z | tools/face/__make_cs6_split_annot.py | AruniRC/detectron-self-train | a5d0edc51aeab92b953948ef2401294e87efb719 | [
"MIT"
] | 15 | 2019-06-12T03:55:48.000Z | 2021-03-12T07:09:53.000Z | tools/face/__make_cs6_split_annot.py | AruniRC/detectron-self-train | a5d0edc51aeab92b953948ef2401294e87efb719 | [
"MIT"
] | 24 | 2019-04-12T17:06:30.000Z | 2021-07-12T12:38:20.000Z |
"""
Create ground-truth annotation files for IJBC-style evaluation on CS6.
By default the "val" split is considered, using validation videos listed in
data/CS6/list_video_val.txt.
NOTE: create symlink to "/mnt/nfs/work1/elm/arunirc/Data/CS6_annots/" at "data/CS6_annots".
Usage:
srun --pty --mem 50000 python tool... | 32.268116 | 111 | 0.543454 |
from __future__ import absolute_import
from __future__ import division
import matplotlib
matplotlib.use('Agg')
import sys
sys.path.append('./tools')
import _init_paths
import numpy as np
import os
import argparse
import os.path as osp
import time
from six.moves import xrange
import utils.face_utils as face_utils
... | true | true |
1c340e1d1cf5c12e33fe0ec46bb8d38eb17ee24d | 1,016 | py | Python | src/OFS/tests/testLockable.py | rbanffy/Zope | ecf6770219052e7c7f8c9634ddf187a1e6280742 | [
"ZPL-2.1"
] | 289 | 2015-01-05T12:38:21.000Z | 2022-03-05T21:20:39.000Z | src/OFS/tests/testLockable.py | rbanffy/Zope | ecf6770219052e7c7f8c9634ddf187a1e6280742 | [
"ZPL-2.1"
] | 732 | 2015-02-09T23:35:57.000Z | 2022-03-31T09:10:13.000Z | src/OFS/tests/testLockable.py | rbanffy/Zope | ecf6770219052e7c7f8c9634ddf187a1e6280742 | [
"ZPL-2.1"
] | 102 | 2015-01-12T14:03:35.000Z | 2022-03-30T11:02:44.000Z | import unittest
from OFS.interfaces import IWriteLock
from zope.interface import implementer
@implementer(IWriteLock)
class LockableResource:
def __init__(self, locked):
self.locked = locked
def wl_isLocked(self):
return self.locked
class UnlockableResource:
pass
class TestUtilFunct... | 26.736842 | 58 | 0.729331 | import unittest
from OFS.interfaces import IWriteLock
from zope.interface import implementer
@implementer(IWriteLock)
class LockableResource:
def __init__(self, locked):
self.locked = locked
def wl_isLocked(self):
return self.locked
class UnlockableResource:
pass
class TestUtilFunct... | true | true |
1c340e8db8d7a89fc4a7b2e9665f3d46e309f7d4 | 1,061 | py | Python | git_gopher/DeleteTagRemote.py | derekhamilton/git-gud | 7fd377a39796b0aa1268e7ecda6808e8e45173fe | [
"MIT"
] | 15 | 2019-11-13T20:59:53.000Z | 2020-12-15T05:21:21.000Z | git_gopher/DeleteTagRemote.py | derekhamilton/git-gud | 7fd377a39796b0aa1268e7ecda6808e8e45173fe | [
"MIT"
] | 50 | 2019-10-12T16:57:11.000Z | 2019-10-27T21:03:22.000Z | git_gopher/DeleteTagRemote.py | derekhamilton/git-gud | 7fd377a39796b0aa1268e7ecda6808e8e45173fe | [
"MIT"
] | 1 | 2019-11-14T03:20:21.000Z | 2019-11-14T03:20:21.000Z | from git_gopher.CommandInterface import CommandInterface
from git_gopher.HistoryCommandRunner import HistoryCommandRunner
from git_gopher.GitDataGetter import GitDataGetter
class DeleteTagRemote(CommandInterface):
def __init__(self, hist_command_runner: HistoryCommandRunner, git_data_getter: GitDataGetter):
... | 42.44 | 130 | 0.664467 | from git_gopher.CommandInterface import CommandInterface
from git_gopher.HistoryCommandRunner import HistoryCommandRunner
from git_gopher.GitDataGetter import GitDataGetter
class DeleteTagRemote(CommandInterface):
def __init__(self, hist_command_runner: HistoryCommandRunner, git_data_getter: GitDataGetter):
... | true | true |
1c34115300559310ebe35a731ce334a5b031a186 | 1,907 | py | Python | deepspeech_pytorch/loss.py | welgazil/DeDTW | 05d46c68122521dfe706736aaff24d6f99807e6e | [
"MIT"
] | null | null | null | deepspeech_pytorch/loss.py | welgazil/DeDTW | 05d46c68122521dfe706736aaff24d6f99807e6e | [
"MIT"
] | null | null | null | deepspeech_pytorch/loss.py | welgazil/DeDTW | 05d46c68122521dfe706736aaff24d6f99807e6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 3 11:53:32 2021
@author: louisbard
"""
# import numpy as np
import torch
import torch.nn as nn
# import torch.nn.functional as F
from deepspeech_pytorch.soft_dtw import SoftDTW
from deepspeech_pytorch.gauss import distcos
class DTWLosslabels(n... | 32.87931 | 120 | 0.629261 |
import torch
import torch.nn as nn
from deepspeech_pytorch.soft_dtw import SoftDTW
from deepspeech_pytorch.gauss import distcos
class DTWLosslabels(nn.Module):
def __init__(self, representation):
super(DTWLosslabels, self).__init__()
self.sdtw = SoftDTW(gamma=1.0, normalize=True, dist="cosine")... | true | true |
1c341224ea77f0c0bf517aac747cfaae30d1066b | 4,287 | py | Python | tools/lib-alert-tree/lib_alert_tree/prometheus.py | SaintLoong/metalk8s | 06fa3a731f35ab0f9ad8d3443fd8f8c4e7037432 | [
"Apache-2.0"
] | 23 | 2018-03-16T09:06:46.000Z | 2018-08-02T00:02:07.000Z | tools/lib-alert-tree/lib_alert_tree/prometheus.py | SaintLoong/metalk8s | 06fa3a731f35ab0f9ad8d3443fd8f8c4e7037432 | [
"Apache-2.0"
] | 131 | 2018-03-13T07:31:34.000Z | 2018-08-02T21:57:18.000Z | tools/lib-alert-tree/lib_alert_tree/prometheus.py | SaintLoong/metalk8s | 06fa3a731f35ab0f9ad8d3443fd8f8c4e7037432 | [
"Apache-2.0"
] | 4 | 2018-04-03T07:18:39.000Z | 2018-07-02T22:56:56.000Z | """Classes for storing and serializing Prometheus alert rules."""
import abc
import operator
import yaml
EXACT_MATCH_LABELS = frozenset(["alertstate", "alertname", "severity"])
class Serializable(metaclass=abc.ABCMeta):
"""Base-class for data serializable into YAML strings."""
@abc.abstractmethod
def ... | 29.163265 | 82 | 0.563798 |
import abc
import operator
import yaml
EXACT_MATCH_LABELS = frozenset(["alertstate", "alertname", "severity"])
class Serializable(metaclass=abc.ABCMeta):
@abc.abstractmethod
def serialize(self):
return {}
def dump(self, out=None):
return yaml.safe_dump(
self.serialize(), s... | true | true |
1c34131c9f689c78e777d6970a99f16b0f8b4b23 | 512 | py | Python | src/Plot_tools/__init__.py | nishantsule/PyRsw | 753788608a0d227b5c8dc8b863d85bfc3a907310 | [
"MIT"
] | null | null | null | src/Plot_tools/__init__.py | nishantsule/PyRsw | 753788608a0d227b5c8dc8b863d85bfc3a907310 | [
"MIT"
] | null | null | null | src/Plot_tools/__init__.py | nishantsule/PyRsw | 753788608a0d227b5c8dc8b863d85bfc3a907310 | [
"MIT"
] | null | null | null | # Plot_tools
# This module provides the functions used
# for visualizing results from a PyRSW
# simulation
# Import the plotting tools
from Plot_tools.initialize_plots_animsave_1D import initialize_plots_animsave_1D
from Plot_tools.initialize_plots_animsave_2D import initialize_plots_animsave_2D
from... | 39.384615 | 80 | 0.849609 |
from Plot_tools.initialize_plots_animsave_1D import initialize_plots_animsave_1D
from Plot_tools.initialize_plots_animsave_2D import initialize_plots_animsave_2D
from Plot_tools.initialize_plots_hov import initialize_plots_hov
from Plot_tools.plot_hov import plot_hov
from Plot_tools.update_hov import update_hov
from P... | true | true |
1c34131f5d8c76c9c56c1b80ea4408150a7a4aab | 1,706 | py | Python | ooobuild/lo/uno/x_reference.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/uno/x_reference.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/uno/x_reference.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.086957 | 249 | 0.732708 | from abc import abstractmethod
from .x_interface import XInterface as XInterface_8f010a43
class XReference(XInterface_8f010a43):
__ooo_ns__: str = 'com.sun.star.uno'
__ooo_full_ns__: str = 'com.sun.star.uno.XReference'
__ooo_type_name__: str = 'interface'
__pyunointerface__: str = 'com.sun.star.uno.XRe... | true | true |
1c3413eb37c6a11a85248a02655f54824f19eeec | 17,089 | py | Python | tests/test_graceful_reload.py | twu/pypicloud | 1ff40b8bcb2f123acab93248368e114cca123504 | [
"MIT"
] | 336 | 2016-10-05T14:15:23.000Z | 2022-03-17T12:42:10.000Z | tests/test_graceful_reload.py | twu/pypicloud | 1ff40b8bcb2f123acab93248368e114cca123504 | [
"MIT"
] | 215 | 2016-10-03T20:17:09.000Z | 2022-03-29T18:03:46.000Z | tests/test_graceful_reload.py | twu/pypicloud | 1ff40b8bcb2f123acab93248368e114cca123504 | [
"MIT"
] | 104 | 2016-10-03T18:58:26.000Z | 2022-02-10T00:23:28.000Z | """ Tests for gracefully reloading the caches """
import unittest
from datetime import timedelta
import redis
import transaction
from mock import MagicMock
from pyramid.testing import DummyRequest
from sqlalchemy.exc import OperationalError
from pypicloud.cache import RedisCache, SQLCache
from pypicloud.cache.dynamo ... | 37.069414 | 91 | 0.6259 | import unittest
from datetime import timedelta
import redis
import transaction
from mock import MagicMock
from pyramid.testing import DummyRequest
from sqlalchemy.exc import OperationalError
from pypicloud.cache import RedisCache, SQLCache
from pypicloud.cache.dynamo import DynamoCache, DynamoPackage, PackageSummary
... | true | true |
1c34149b9cfd658fb4f97781ad55439fe6439063 | 1,442 | py | Python | Electronic Station/timeConverter12Hto24H.py | amatsuraki/CheckiO-Elementary- | e041ea41b1f5ff59618c810468dec005bb797883 | [
"MIT"
] | null | null | null | Electronic Station/timeConverter12Hto24H.py | amatsuraki/CheckiO-Elementary- | e041ea41b1f5ff59618c810468dec005bb797883 | [
"MIT"
] | null | null | null | Electronic Station/timeConverter12Hto24H.py | amatsuraki/CheckiO-Elementary- | e041ea41b1f5ff59618c810468dec005bb797883 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- Coding: utf-8 -*-
"""
[Time converter 12h to 24h]
You are the modern man who prefers the 24-hour time format. But the 12-hour format is used in some places. Your task is to convert the time from the 12-h format into 24-h by following the next rules:
- the output format should be 'hh:mm'
- ... | 28.84 | 200 | 0.574896 |
def time_converter(time):
time = time.split(" ")
time0 = time[0].split(":")
hour = int(time0[0])
minute = time0[1]
if time[1] == "a.m.":
if hour is not 12:
hour = "{0:02d}".format(hour)
else:
hour = "00"
else:
if hour is not 12:
... | true | true |
1c3415006f05237c1c53f3c865f96ea8235e73ac | 2,684 | py | Python | plot_grid.py | jonasvj/TFDE | c5d25947b28524c7a40626f797ca8c157fa70a53 | [
"MIT"
] | null | null | null | plot_grid.py | jonasvj/TFDE | c5d25947b28524c7a40626f797ca8c157fa70a53 | [
"MIT"
] | null | null | null | plot_grid.py | jonasvj/TFDE | c5d25947b28524c7a40626f797ca8c157fa70a53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def tt_params(K, M):
return K + 3*M*K**2
def tt_dof(K, M):
return (K-1) + M*K*(K-1) + 2*M*K**2
def bic(n, k, nllh_per_sample):
log_lh = -1*nllh_per_sample*n
return k*np.log(n) - 2*log_lh
def aic(... | 33.974684 | 80 | 0.618107 | import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def tt_params(K, M):
return K + 3*M*K**2
def tt_dof(K, M):
return (K-1) + M*K*(K-1) + 2*M*K**2
def bic(n, k, nllh_per_sample):
log_lh = -1*nllh_per_sample*n
return k*np.log(n) - 2*log_lh
def aic(n, k, nllh_per_sample):... | true | true |
1c341554ac9b7a0b6cb004b22f6f12d6d712fcb7 | 267 | py | Python | jp.atcoder/abc136/abc136_c/12000304.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc136/abc136_c/12000304.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc136/abc136_c/12000304.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
n, *h = map(int, sys.stdin.read().split())
def main():
ans = 'Yes'
for i in range(n - 1, 0, -1):
if h[i-1] > h[i]: h[i-1] -= 1
if h[i-1] > h[i]: ans = 'No'; break
print(ans)
if __name__ == '__main__':
main()
| 19.071429 | 44 | 0.449438 | import sys
n, *h = map(int, sys.stdin.read().split())
def main():
ans = 'Yes'
for i in range(n - 1, 0, -1):
if h[i-1] > h[i]: h[i-1] -= 1
if h[i-1] > h[i]: ans = 'No'; break
print(ans)
if __name__ == '__main__':
main()
| true | true |
1c34161cb6d656bb855f3974b66bc85b05c6f779 | 6,909 | py | Python | test/test_catalog.py | mickybart/openbrokerapi | a2d57334da0061425731adc4e10376f2123f71f1 | [
"MIT"
] | null | null | null | test/test_catalog.py | mickybart/openbrokerapi | a2d57334da0061425731adc4e10376f2123f71f1 | [
"MIT"
] | null | null | null | test/test_catalog.py | mickybart/openbrokerapi | a2d57334da0061425731adc4e10376f2123f71f1 | [
"MIT"
] | null | null | null | import http
from openbrokerapi.catalog import (
ServiceDashboardClient,
ServiceMetadata,
ServicePlan,
ServicePlanCost,
ServicePlanMetaData,
)
from openbrokerapi.service_broker import Service
from test import BrokerTestCase
class CatalogTest(BrokerTestCase):
service = Service(
id="s1",... | 38.383333 | 106 | 0.4099 | import http
from openbrokerapi.catalog import (
ServiceDashboardClient,
ServiceMetadata,
ServicePlan,
ServicePlanCost,
ServicePlanMetaData,
)
from openbrokerapi.service_broker import Service
from test import BrokerTestCase
class CatalogTest(BrokerTestCase):
service = Service(
id="s1",... | true | true |
1c3416ab88fda022aac2cf4ef1c028fed8372863 | 427 | py | Python | Problem Solving/Search Algorithms/Data Structure Examples/Stack.py | cholazzzb/A-Study-of-AI | b069d536eb344a363d1b042086926d026afc0360 | [
"MIT"
] | null | null | null | Problem Solving/Search Algorithms/Data Structure Examples/Stack.py | cholazzzb/A-Study-of-AI | b069d536eb344a363d1b042086926d026afc0360 | [
"MIT"
] | null | null | null | Problem Solving/Search Algorithms/Data Structure Examples/Stack.py | cholazzzb/A-Study-of-AI | b069d536eb344a363d1b042086926d026afc0360 | [
"MIT"
] | null | null | null | class Stack(object):
'Stack'
def __init__(self, build):
self.data = [build]
print("Stack :", self.data)
def push(self, new):
self.data.append(new)
print("Stack :", self.data)
def pop(self):
out = self.data.pop(-1)
print("Stack :", self.data)
... | 17.08 | 35 | 0.552693 | class Stack(object):
def __init__(self, build):
self.data = [build]
print("Stack :", self.data)
def push(self, new):
self.data.append(new)
print("Stack :", self.data)
def pop(self):
out = self.data.pop(-1)
print("Stack :", self.data)
return out
... | true | true |
1c34177280393478e3fc7c88fc4d2eed5f5f808e | 524 | py | Python | backend/home/migrations/0002_homme1.py | crowdbotics-dev/retyetuytrd-dev-23670 | ed9bf7a6d019152274452ca82896664771233b81 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0002_homme1.py | crowdbotics-dev/retyetuytrd-dev-23670 | ed9bf7a6d019152274452ca82896664771233b81 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0002_homme1.py | crowdbotics-dev/retyetuytrd-dev-23670 | ed9bf7a6d019152274452ca82896664771233b81 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.26 on 2022-03-11 07:27
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('home', '0001_load_initial_data'),
]
operations = [
migrations.CreateModel(
name='Homme1',
field... | 22.782609 | 114 | 0.572519 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('home', '0001_load_initial_data'),
]
operations = [
migrations.CreateModel(
name='Homme1',
fields=[
('id', models.AutoField(auto_... | true | true |
1c3418889fe5c8db858f699a6da7c157d7e3c801 | 8,302 | py | Python | src/m5r_fancy_iterating.py | munnamn/11-Sequences | 8e03697d635fb7121e393402462b1caa341ba45b | [
"MIT"
] | null | null | null | src/m5r_fancy_iterating.py | munnamn/11-Sequences | 8e03697d635fb7121e393402462b1caa341ba45b | [
"MIT"
] | null | null | null | src/m5r_fancy_iterating.py | munnamn/11-Sequences | 8e03697d635fb7121e393402462b1caa341ba45b | [
"MIT"
] | null | null | null | """
This module shows how to ITERATE (i.e. loop) through a SEQUENCE
in ways OTHER than just going thru the sequence from BEGINNING to END.
It also shows how to SELECT items in a sequence, e.g.:
-- the items that are strings
-- the items that are even integers (e.g. 2, 4, 6, ...)
Note that:
-- SELECTING items th... | 34.448133 | 79 | 0.503252 |
def main():
run_test_sum_string_lengths()
run_test_sum_even_integers()
run_test_sum_items_at_even_indices()
def sum_string_lengths(sequence, m, n):
total = 0
for k in range(n, m - 1, -1):
s = sequence[k]
total = total + len(s)
return total
total = 0
... | true | true |
1c3418a9ba18af2f77f23c15c0404c43548e23c4 | 1,446 | py | Python | setup.py | ChaitanyaSinghBisht/PyWhatKit | ff4b876fb8846f3afa4c9a84b1aa1bd676225207 | [
"MIT"
] | 1 | 2021-01-27T11:34:24.000Z | 2021-01-27T11:34:24.000Z | setup.py | AshleyAlexJacob/PyWhatKit | 866f960f6309378959d9a47e1e2d6854952ca273 | [
"MIT"
] | 3 | 2021-09-08T03:19:26.000Z | 2022-03-12T00:58:05.000Z | setup.py | AshleyAlexJacob/PyWhatKit | 866f960f6309378959d9a47e1e2d6854952ca273 | [
"MIT"
] | null | null | null | from distutils.core import setup
import setuptools
def readme():
with open(r'README.md') as f:
README = f.read()
return README
setup(
name = 'pywhatkit',
packages = setuptools.find_packages(),
version = '2.9',
license='MIT',
description = 'pywhatkit is a Python library... | 32.863636 | 132 | 0.609267 | from distutils.core import setup
import setuptools
def readme():
with open(r'README.md') as f:
README = f.read()
return README
setup(
name = 'pywhatkit',
packages = setuptools.find_packages(),
version = '2.9',
license='MIT',
description = 'pywhatkit is a Python library... | true | true |
1c341977f01cd73a75c3fd0b665b08c602d34f78 | 1,857 | py | Python | Python-Programs/Sorting Algorithms/pancakeSort.py | naschwin/Simple-Programs | a06e62b7280890cc8e3b9d2dfac9b7fd90706af3 | [
"MIT"
] | null | null | null | Python-Programs/Sorting Algorithms/pancakeSort.py | naschwin/Simple-Programs | a06e62b7280890cc8e3b9d2dfac9b7fd90706af3 | [
"MIT"
] | null | null | null | Python-Programs/Sorting Algorithms/pancakeSort.py | naschwin/Simple-Programs | a06e62b7280890cc8e3b9d2dfac9b7fd90706af3 | [
"MIT"
] | 1 | 2021-10-09T09:51:22.000Z | 2021-10-09T09:51:22.000Z | import pygame, sys, random
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
WIDTH = 720
HEIGHT = 400
win_size = (WIDTH, HEIGHT)
pygame.init()
win = pygame.display.set_mode(win_size)
pygame.display.set_caption('Pancake Sort')
clock = pygame.time.Clock()
#width of the bars
n = 4
w = int(WIDTH/n)
h_arr =... | 22.925926 | 116 | 0.501885 | import pygame, sys, random
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
WIDTH = 720
HEIGHT = 400
win_size = (WIDTH, HEIGHT)
pygame.init()
win = pygame.display.set_mode(win_size)
pygame.display.set_caption('Pancake Sort')
clock = pygame.time.Clock()
n = 4
w = int(WIDTH/n)
h_arr = []
states = []
... | true | true |
1c341a125f820f2c895baafa6db006a93966988e | 6,374 | py | Python | tempest/api/image/base.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/api/image/base.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/api/image/base.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 38.167665 | 79 | 0.617038 |
import cStringIO as StringIO
from tempest import clients
from tempest.common import isolated_creds
from tempest.common.utils import data_utils
from tempest import exceptions
from tempest.openstack.common import log as logging
import tempest.test
LOG = logging.getLogger(__name__)
class BaseImageTest(tempest.test.Ba... | true | true |
1c341a4678e8e2200ae0b0556e8e280719fa2b93 | 8,103 | py | Python | wrappers/python/virgil_crypto_lib/foundation/aes256_cbc.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 26 | 2018-12-17T13:45:25.000Z | 2022-01-16T20:00:04.000Z | wrappers/python/virgil_crypto_lib/foundation/aes256_cbc.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 4 | 2019-01-03T12:08:52.000Z | 2021-12-02T05:21:13.000Z | wrappers/python/virgil_crypto_lib/foundation/aes256_cbc.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 8 | 2019-01-24T08:22:06.000Z | 2022-02-07T11:37:00.000Z | # Copyright (C) 2015-2021 Virgil Security, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this li... | 40.515 | 117 | 0.710971 |
from ctypes import *
from ._c_bridge import VscfAes256Cbc
from ._c_bridge import VscfImplTag
from ._c_bridge import VscfStatus
from virgil_crypto_lib.common._c_bridge import Data
from virgil_crypto_lib.common._c_bridge import Buffer
from .alg import Alg
from .encrypt import Encrypt
from .decrypt import Decrypt
from .... | true | true |
1c341b88dfddbd4f7080f9bdde084e142e7f3d29 | 1,008 | py | Python | code/Solution_0447_numberOfBoomerangs.py | qizhenkang/myLeetCode | cb9edce69567eba9d96ce756507a5a7ac6e74293 | [
"MIT"
] | null | null | null | code/Solution_0447_numberOfBoomerangs.py | qizhenkang/myLeetCode | cb9edce69567eba9d96ce756507a5a7ac6e74293 | [
"MIT"
] | null | null | null | code/Solution_0447_numberOfBoomerangs.py | qizhenkang/myLeetCode | cb9edce69567eba9d96ce756507a5a7ac6e74293 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 13 09:43:47 2021
@author: qizhe
"""
class Solution:
def numberOfBoomerangs(self, points) -> int:
result = 0
for pi in points:
distdict = {}
for pj in points:
dist = (pi[0] - pj[0])**2 + (pi[1] - pj[1])... | 24 | 62 | 0.499008 |
class Solution:
def numberOfBoomerangs(self, points) -> int:
result = 0
for pi in points:
distdict = {}
for pj in points:
dist = (pi[0] - pj[0])**2 + (pi[1] - pj[1])**2
if dist not in distdict:
distdict[dist] = 1
... | true | true |
1c341bbaa6104c7364e7f7be8428c56c2f7c75d0 | 8,832 | py | Python | sdk/python/pulumi_azure/network/virtual_hub_connection.py | adnang/pulumi-azure | 32360d2f1e41e27d7fdd6522cb26d65e531f279f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/network/virtual_hub_connection.py | adnang/pulumi-azure | 32360d2f1e41e27d7fdd6522cb26d65e531f279f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/network/virtual_hub_connection.py | adnang/pulumi-azure | 32360d2f1e41e27d7fdd6522cb26d65e531f279f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Virtua... | 61.762238 | 292 | 0.733809 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class VirtualHubConnection(pulumi.CustomResource):
hub_to_vitual_network_traffic_allowed: pulumi.Output[bool]
internet_security_enabled: pulumi.Output[bool]
name: pulumi.Output[str]
... | true | true |
1c341e35933bcdb0812891953bdb7c49dedc7b37 | 578 | py | Python | text/color/_rgb/_rgba.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/color/_rgb/_rgba.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/color/_rgb/_rgba.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | """
*Rgba*
The color spectral measure using the RGBA system.
"""
from dataclasses import dataclass
# from wich.measure.spectral import Spectral
from .red import Red
from .green import Green
from .blue import Blue
__all__ = [
"Rgba",
]
@dataclass
class Rgba(
# Spectral,
# GraphicalColor,
):
... | 12.844444 | 51 | 0.550173 |
from dataclasses import dataclass
from .red import Red
from .green import Green
from .blue import Blue
__all__ = [
"Rgba",
]
@dataclass
class Rgba(
):
red: Red
green: Green
blue: Blue
@classmethod
def create(
cls,
red: int,
green: int,
blue: int,
... | true | true |
1c341e9953b24c6332cd370640c276a8aedd7d2e | 1,687 | py | Python | kontenjan.py | abkkl/me | a0ba942d02c5d503f977c2db62c21e3083c8e5cb | [
"Apache-2.0"
] | null | null | null | kontenjan.py | abkkl/me | a0ba942d02c5d503f977c2db62c21e3083c8e5cb | [
"Apache-2.0"
] | null | null | null | kontenjan.py | abkkl/me | a0ba942d02c5d503f977c2db62c21e3083c8e5cb | [
"Apache-2.0"
] | null | null | null | import mechanize
from bs4 import BeautifulSoup
import openpyxl
import time
import ctypes
wb = openpyxl.Workbook()
ws = wb.active
print("Course Capacity Checker Created by Ahmet Bakkal 2022\n")
ders = input("Course Code (i.e. END458E):").upper()
crn = input("CRN Number (i.e. 21268):")
def itukont(ders,... | 27.209677 | 147 | 0.5246 | import mechanize
from bs4 import BeautifulSoup
import openpyxl
import time
import ctypes
wb = openpyxl.Workbook()
ws = wb.active
print("Course Capacity Checker Created by Ahmet Bakkal 2022\n")
ders = input("Course Code (i.e. END458E):").upper()
crn = input("CRN Number (i.e. 21268):")
def itukont(ders,... | true | true |
1c341ec043178dd20596c680ef1491f1e21f2686 | 12,564 | py | Python | python/ccxt/async_support/base/exchange.py | 1Konto/ccxt | 817eace045a87b441f009c2303827b3df5e1f339 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | 1Konto/ccxt | 817eace045a87b441f009c2303827b3df5e1f339 | [
"MIT"
] | 1 | 2019-09-19T06:38:21.000Z | 2019-09-19T06:38:21.000Z | python/ccxt/async_support/base/exchange.py | 1Konto/ccxt | 817eace045a87b441f009c2303827b3df5e1f339 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.18.1165'
# -----------------------------------------------------------------------------
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import... | 41.740864 | 355 | 0.610236 |
__version__ = '1.18.1165'
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttle import throttle
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ExchangeNot... | true | true |
1c341f0ecec81fd94df513cec1e8797119db1d81 | 195 | py | Python | setup.py | AdamBlomfield/mod_4_project | dad5775535d50ad4d3d9a8cafdc638572d978ca3 | [
"RSA-MD"
] | 2 | 2019-06-18T12:57:42.000Z | 2019-07-10T15:28:48.000Z | setup.py | AdamBlomfield/mod_4_project | dad5775535d50ad4d3d9a8cafdc638572d978ca3 | [
"RSA-MD"
] | null | null | null | setup.py | AdamBlomfield/mod_4_project | dad5775535d50ad4d3d9a8cafdc638572d978ca3 | [
"RSA-MD"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='mod_4_final_project',
author='far',
#license='',
)
| 17.727273 | 43 | 0.651282 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='mod_4_final_project',
author='far',
)
| true | true |
1c341fc8a17cbd253c660ba3cf5f1ac0c9f71bb8 | 16,537 | py | Python | sans_tools/NotesAppFe.py | Developernation/PythonProjects | d682960d060cb1daede3f2f8e814a5aea05c0ec6 | [
"BSD-3-Clause"
] | 11 | 2022-02-12T23:50:27.000Z | 2022-03-04T01:24:14.000Z | sans_tools/NotesAppFe.py | Developernation/PythonProjects | d682960d060cb1daede3f2f8e814a5aea05c0ec6 | [
"BSD-3-Clause"
] | null | null | null | sans_tools/NotesAppFe.py | Developernation/PythonProjects | d682960d060cb1daede3f2f8e814a5aea05c0ec6 | [
"BSD-3-Clause"
] | 1 | 2022-03-27T22:28:37.000Z | 2022-03-27T22:28:37.000Z | from tkinter.filedialog import askopenfilename
from tkinter.messagebox import showinfo
from NotesApp import SansNotesApp as snp
from datetime import datetime
from tkinter import ttk
import tkinter as tk
import pandas as pd
import os
pd.set_option('display.max_rows', None)
#database connection
notes_db = snp()
notes_db... | 32.173152 | 138 | 0.600774 | from tkinter.filedialog import askopenfilename
from tkinter.messagebox import showinfo
from NotesApp import SansNotesApp as snp
from datetime import datetime
from tkinter import ttk
import tkinter as tk
import pandas as pd
import os
pd.set_option('display.max_rows', None)
notes_db = snp()
notes_db.database_name = 'san... | true | true |
1c3421c57b17d9a16190870d5ee5157487dc1ffc | 5,474 | py | Python | gluon/_compat.py | zhiyongwang/web2py | 759616e537deb6148b8f32430e214142b4a65261 | [
"BSD-3-Clause"
] | null | null | null | gluon/_compat.py | zhiyongwang/web2py | 759616e537deb6148b8f32430e214142b4a65261 | [
"BSD-3-Clause"
] | null | null | null | gluon/_compat.py | zhiyongwang/web2py | 759616e537deb6148b8f32430e214142b4a65261 | [
"BSD-3-Clause"
] | null | null | null | import sys
import hashlib
import os
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
import cPickle as pickle
from cStringIO import StringIO
import copy_reg as copyreg
from HTMLParser import HTMLParser
import urlparse
from htmlentitydefs import entitydefs, name2codepoint
imp... | 31.641618 | 88 | 0.654183 | import sys
import hashlib
import os
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
import cPickle as pickle
from cStringIO import StringIO
import copy_reg as copyreg
from HTMLParser import HTMLParser
import urlparse
from htmlentitydefs import entitydefs, name2codepoint
imp... | true | true |
1c3421ddc32d9035bd1863f644152cdb8cfd4a61 | 6,610 | py | Python | django_sass_finder/finders.py | Tru-Dev/django_sass_finder | 2541e30b1167abd4154ed946aaae7531d3f2a94a | [
"MIT"
] | 1 | 2020-10-24T23:17:18.000Z | 2020-10-24T23:17:18.000Z | django_sass_finder/finders.py | Tru-Dev/django_sass_finder | 2541e30b1167abd4154ed946aaae7531d3f2a94a | [
"MIT"
] | 2 | 2021-09-13T09:41:16.000Z | 2021-09-17T15:56:24.000Z | django_sass_finder/finders.py | Tru-Dev/django_sass_finder | 2541e30b1167abd4154ed946aaae7531d3f2a94a | [
"MIT"
] | 3 | 2021-04-13T18:16:45.000Z | 2021-09-12T12:05:34.000Z | # -*- coding: utf-8 -*-
import stat
from pathlib import Path
import sass
from django.apps import apps
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder, AppDirectoriesFinder, BaseFinder
from django.core.checks import Error
from django.core.files.storage import FileSystem... | 38.208092 | 103 | 0.581997 | import stat
from pathlib import Path
import sass
from django.apps import apps
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder, AppDirectoriesFinder, BaseFinder
from django.core.checks import Error
from django.core.files.storage import FileSystemStorage
__all__ = (
... | true | true |
1c34231126a265909f39756cbb8e3e90cd5157cc | 652 | py | Python | pywikibot/compat/userlib.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | 1 | 2020-01-03T11:52:01.000Z | 2020-01-03T11:52:01.000Z | pywikibot/compat/userlib.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | 2 | 2019-11-07T13:46:32.000Z | 2019-11-07T14:20:53.000Z | pywikibot/compat/userlib.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
Do not use in new scripts; use the source to find the appropriate
function/method instead.
"""
#
# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_impo... | 26.08 | 70 | 0.707055 | from __future__ import absolute_import, division, unicode_literals
from pywikibot.page import User
from pywikibot.tools import ModuleDeprecationWrapper
__all__ = ('User',)
wrapper = ModuleDeprecationWrapper(__name__)
wrapper._add_deprecated_attr('User',
replacement_name='pywikibot.User',... | true | true |
1c34234f58c4cfb7a22a62835900d0f0b2695b61 | 13,645 | py | Python | thrift/compiler/test/fixtures/complex-union/gen-py3lite/module/lite_metadata.py | dgrnbrg-meta/fbthrift | 1d5f0799ef53feeb83425b6c9c79f86aeac7d9ed | [
"Apache-2.0"
] | null | null | null | thrift/compiler/test/fixtures/complex-union/gen-py3lite/module/lite_metadata.py | dgrnbrg-meta/fbthrift | 1d5f0799ef53feeb83425b6c9c79f86aeac7d9ed | [
"Apache-2.0"
] | 1 | 2022-03-03T09:40:25.000Z | 2022-03-03T09:40:25.000Z | thrift/compiler/test/fixtures/complex-union/gen-py3lite/module/lite_metadata.py | dgrnbrg-meta/fbthrift | 1d5f0799ef53feeb83425b6c9c79f86aeac7d9ed | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Thrift
#
# DO NOT EDIT
# @generated
#
import apache.thrift.metadata.lite_types as _fbthrift_metadata
# TODO (ffrancet): This general pattern can be optimized by using tuples and dicts
# instead of re-generating thrift structs
def _fbthrift_gen_metadata_struct_ComplexUnion(metadata_struct: _fbthr... | 54.36255 | 403 | 0.785196 | import apache.thrift.metadata.lite_types as _fbthrift_metadata
def _fbthrift_gen_metadata_struct_ComplexUnion(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata:
qualified_name = "module.ComplexUnion"
if qualified_name in metadata_struct.structs:
return metadata_... | true | true |
1c3423996610ed84883be5d37c04c4b1a7904461 | 10,743 | py | Python | src/pystockwatch/pystockwatch.py | UBC-MDS/Pystockwatch | 4c72dae96d392cf2681b043db6e2fd440c936e49 | [
"MIT"
] | null | null | null | src/pystockwatch/pystockwatch.py | UBC-MDS/Pystockwatch | 4c72dae96d392cf2681b043db6e2fd440c936e49 | [
"MIT"
] | 55 | 2022-01-13T08:26:19.000Z | 2022-02-05T11:24:07.000Z | src/pystockwatch/pystockwatch.py | UBC-MDS/Pystockwatch | 4c72dae96d392cf2681b043db6e2fd440c936e49 | [
"MIT"
] | 1 | 2022-01-29T19:33:30.000Z | 2022-01-29T19:33:30.000Z | # authors: Affrin Sultana, Helin Wang, Shi Yan Wang and Pavel Levchenko
# January,2022
# import plotly.express as px
import plotly.graph_objects as go
import altair as alt
import pandas as pd
import numpy as np
import yfinance as yf
import pandas_datareader as pdr
import datetime
import warnings
alt.renderers.enable('... | 35.572848 | 164 | 0.626361 |
import plotly.graph_objects as go
import altair as alt
import pandas as pd
import numpy as np
import yfinance as yf
import pandas_datareader as pdr
import datetime
import warnings
alt.renderers.enable('altair_viewer')
def percent_change(stock_ticker, start_date, end_date):
ticker = yf.Ticker(stock_ticker... | true | true |
1c3423a4b26e69f635ef04ef776574436569154e | 2,900 | py | Python | npxconv.py | LeeTehi/nnvolterra | d6a084d2f5b4b716423cb4b952cf58a09ea84c23 | [
"MIT"
] | 1 | 2021-11-28T17:16:57.000Z | 2021-11-28T17:16:57.000Z | npxconv.py | LeeTehi/nnvolterra | d6a084d2f5b4b716423cb4b952cf58a09ea84c23 | [
"MIT"
] | null | null | null | npxconv.py | LeeTehi/nnvolterra | d6a084d2f5b4b716423cb4b952cf58a09ea84c23 | [
"MIT"
] | null | null | null | import libnpxconv as libx
import numpy as np
# params for libx (sedt, kernel, srcx, /, padleft, stride)
def conv_ordern(ker, *src, oshape=None, padleft=0, stride=1):
if len(src) == 1:
src = src[0]
if oshape is None:
if isinstance(src, (list, tuple)):
assert np.ndim(ker) == len(sr... | 29 | 72 | 0.553103 | import libnpxconv as libx
import numpy as np
def conv_ordern(ker, *src, oshape=None, padleft=0, stride=1):
if len(src) == 1:
src = src[0]
if oshape is None:
if isinstance(src, (list, tuple)):
assert np.ndim(ker) == len(src)
oshape = np.min([np.min(s.shape) for s in sr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.