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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c37d15a08615b8399b234c97c570adaf8660123 | 2,834 | py | Python | eoxserver/services/ows/wcs/v11/describecoverage.py | constantinius/eoxserver_combined | 68f261133fed65a4e8a6ddba82b0d2845171e4bf | [
"OML"
] | null | null | null | eoxserver/services/ows/wcs/v11/describecoverage.py | constantinius/eoxserver_combined | 68f261133fed65a4e8a6ddba82b0d2845171e4bf | [
"OML"
] | null | null | null | eoxserver/services/ows/wcs/v11/describecoverage.py | constantinius/eoxserver_combined | 68f261133fed65a4e8a6ddba82b0d2845171e4bf | [
"OML"
] | null | null | null | #-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2013 EOX IT Services GmbH
#
# Permission... | 40.485714 | 83 | 0.702893 |
from eoxserver.core import Component, implements
from eoxserver.core.decoders import xml, kvp, typelist
from eoxserver.services.ows.interfaces import (
ServiceHandlerInterface, GetServiceHandlerInterface,
PostServiceHandlerInterface
)
from eoxserver.services.ows.wcs.basehandlers imp... | true | true |
1c37d16e5211f0fdc491488938e9fe8fd5027f52 | 453 | py | Python | public/migrations/0001_initial.py | Andrew-Chen-Wang/django-infinite-scroll | 2e8871daf7fe37cbbd15a078fb99d8a22e12012f | [
"MIT"
] | null | null | null | public/migrations/0001_initial.py | Andrew-Chen-Wang/django-infinite-scroll | 2e8871daf7fe37cbbd15a078fb99d8a22e12012f | [
"MIT"
] | 3 | 2021-03-30T14:15:27.000Z | 2021-06-10T19:56:36.000Z | public/migrations/0001_initial.py | Andrew-Chen-Wang/django-infinite-scroll | 2e8871daf7fe37cbbd15a078fb99d8a22e12012f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-29 04:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='English',
fields=[
('id', models.BigAutoFie... | 20.590909 | 79 | 0.560706 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='English',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
... | true | true |
1c37d323b295d8307a87e53028346c16fffb06ba | 678 | py | Python | src/python/tensorflow_cloud/version.py | ucdmkt/cloud | 5920c6cbe2f0f56600760d6857f90a170caf3359 | [
"Apache-2.0"
] | null | null | null | src/python/tensorflow_cloud/version.py | ucdmkt/cloud | 5920c6cbe2f0f56600760d6857f90a170caf3359 | [
"Apache-2.0"
] | null | null | null | src/python/tensorflow_cloud/version.py | ucdmkt/cloud | 5920c6cbe2f0f56600760d6857f90a170caf3359 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.882353 | 74 | 0.756637 |
__version__ = "0.1.7.dev"
| true | true |
1c37d3c5e34b3c2b0571209fb3be9fff642cd9c6 | 21,393 | py | Python | pipeline/configs/grb-citeseer/config.py | THUDM/grb | 2f438ccc9e62ffb33a26ca98a95e504985443055 | [
"MIT"
] | 51 | 2021-06-09T06:33:51.000Z | 2022-03-14T07:55:06.000Z | pipeline/configs/grb-citeseer/config.py | THUDM/grb | 2f438ccc9e62ffb33a26ca98a95e504985443055 | [
"MIT"
] | 3 | 2021-08-12T13:12:47.000Z | 2021-12-08T02:16:02.000Z | pipeline/configs/grb-citeseer/config.py | THUDM/grb | 2f438ccc9e62ffb33a26ca98a95e504985443055 | [
"MIT"
] | 11 | 2021-06-10T08:30:05.000Z | 2022-03-28T02:10:11.000Z | """Configuration for reproducing leaderboard of grb-citeseer dataset."""
import torch
import torch.nn.functional as F
from grb.evaluator import metric
model_list = ["gcn",
"gcn_ln",
"gcn_at",
"graphsage",
"graphsage_ln",
"graphsage_at",
... | 39.325368 | 100 | 0.465666 | import torch
import torch.nn.functional as F
from grb.evaluator import metric
model_list = ["gcn",
"gcn_ln",
"gcn_at",
"graphsage",
"graphsage_ln",
"graphsage_at",
"sgcn",
"sgcn_ln",
"sgcn_at",
... | true | true |
1c37d3f21b7a001c9055b55e762d87a2946c1496 | 261 | py | Python | Sources/02XXX/2941/2941.py | DDManager/Baekjoon-Online-Judge | 7dd6d76838d3309bfe5bef46f1778c5776ebdf2a | [
"MIT"
] | 1 | 2019-07-02T09:07:58.000Z | 2019-07-02T09:07:58.000Z | Sources/02XXX/2941/2941.py | DDManager/Baekjoon-Online-Judge | 7dd6d76838d3309bfe5bef46f1778c5776ebdf2a | [
"MIT"
] | null | null | null | Sources/02XXX/2941/2941.py | DDManager/Baekjoon-Online-Judge | 7dd6d76838d3309bfe5bef46f1778c5776ebdf2a | [
"MIT"
] | 1 | 2022-02-13T04:17:10.000Z | 2022-02-13T04:17:10.000Z | ##
# BOJ 2941번 Python 3 소스 코드
# 작성자 : 동동매니저 (DDManager)
#
# ※ 실행 결과
# 사용 메모리 : 32,876 KB / 294,912 KB
# 소요 시간 : 112 ms / 5,000 ms
#
# Copyright 2020. DDManager all rights reserved.
##
import re
print(len(re.sub("(dz=|c=|c-|d-|lj|nj|s=|z=)","0",input()))) | 20.076923 | 60 | 0.582375 |
import re
print(len(re.sub("(dz=|c=|c-|d-|lj|nj|s=|z=)","0",input()))) | true | true |
1c37d3f6f4efd7eafe388a457039c5630ca8ffcf | 828 | py | Python | test/functional/bitcoin_cli.py | karthik2883/ABCCoin | e6daef308ba7bc81a59ba3aff8bc503cdece5cc6 | [
"MIT"
] | 1 | 2018-04-25T12:18:41.000Z | 2018-04-25T12:18:41.000Z | test/functional/bitcoin_cli.py | karthik2883/ABCCoin | e6daef308ba7bc81a59ba3aff8bc503cdece5cc6 | [
"MIT"
] | null | null | null | test/functional/bitcoin_cli.py | karthik2883/ABCCoin | e6daef308ba7bc81a59ba3aff8bc503cdece5cc6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 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 bitcoin-cli"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util ... | 31.846154 | 85 | 0.721014 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
class TestBitcoinCli(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def run_test(self):
self.log.info("Compare responses... | true | true |
1c37d427226bb485f6d7aeb1d6435345e62f6017 | 52 | py | Python | src/allocation/adapters/email.py | jeantardelli/architecture-patterns-with-python | d48c7d6d4a44073b815c7e6770e44cf2e231e35b | [
"MIT"
] | 1 | 2021-04-07T18:04:56.000Z | 2021-04-07T18:04:56.000Z | src/allocation/adapters/email.py | jeantardelli/architecture-patterns-with-python | d48c7d6d4a44073b815c7e6770e44cf2e231e35b | [
"MIT"
] | null | null | null | src/allocation/adapters/email.py | jeantardelli/architecture-patterns-with-python | d48c7d6d4a44073b815c7e6770e44cf2e231e35b | [
"MIT"
] | null | null | null | def send(*args):
print("SENDING EMAIL:", *args)
| 17.333333 | 34 | 0.615385 | def send(*args):
print("SENDING EMAIL:", *args)
| true | true |
1c37d42984d41533828aed23483e53f4a7a0b343 | 1,610 | py | Python | icv/data/core/segmap.py | dmxj/icv | 0b074ec9475f2c70038d2e8b7166414fd5b93e61 | [
"MIT"
] | 5 | 2019-09-10T04:02:19.000Z | 2020-07-24T07:46:08.000Z | icv/data/core/segmap.py | dmxj/icv | 0b074ec9475f2c70038d2e8b7166414fd5b93e61 | [
"MIT"
] | null | null | null | icv/data/core/segmap.py | dmxj/icv | 0b074ec9475f2c70038d2e8b7166414fd5b93e61 | [
"MIT"
] | 1 | 2020-03-20T03:44:04.000Z | 2020-03-20T03:44:04.000Z | # -*- coding: UTF-8 -*-
import numpy as np
class Segmap(object):
DEFAULT_SEGMENT_COLORS = [
(0, 0, 0), # black
(230, 25, 75), # red
(60, 180, 75), # green
(255, 225, 25), # yellow
(0, 130, 200), # blue
(245, 130, 48), # orange
(145, 30, 180), # purple
... | 28.245614 | 40 | 0.418634 |
import numpy as np
class Segmap(object):
DEFAULT_SEGMENT_COLORS = [
(0, 0, 0),
(230, 25, 75),
(60, 180, 75),
(255, 225, 25),
(0, 130, 200),
(245, 130, 48),
(145, 30, 180),
(70, 240, 240),
(240, 50, 230),
(210, 245, 6... | true | true |
1c37d4c8dca32f72c89cbd0b0de7d852eb42ca60 | 10,464 | py | Python | tensor2tensor/mesh_tensorflow/mtf_layers_test.py | ReDeiPirati/tensor2tensor | 39f44893b82a5052c9eddba760fc4094d3d706bb | [
"Apache-2.0"
] | 4 | 2019-04-20T23:28:41.000Z | 2021-01-03T03:21:43.000Z | tensor2tensor/mesh_tensorflow/mtf_layers_test.py | ReDeiPirati/tensor2tensor | 39f44893b82a5052c9eddba760fc4094d3d706bb | [
"Apache-2.0"
] | null | null | null | tensor2tensor/mesh_tensorflow/mtf_layers_test.py | ReDeiPirati/tensor2tensor | 39f44893b82a5052c9eddba760fc4094d3d706bb | [
"Apache-2.0"
] | 1 | 2019-01-29T18:44:17.000Z | 2019-01-29T18:44:17.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 35.713311 | 74 | 0.676223 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensor2tensor.layers import common_layers
from tensor2tensor.mesh_tensorflow import mesh_tensorflow as mtf
from tensor2tensor.mesh_tensorflow import m... | true | true |
1c37d5112ebf0b75c7c97a7889e7af24572cb0ae | 13,851 | py | Python | examples/domain_adaptation/digits/mdd.py | wuaodi/Transfer-Learning-Library | 29a946143e63b66a1da9ffa685bfe95f5640028a | [
"MIT"
] | 1 | 2021-04-08T00:13:13.000Z | 2021-04-08T00:13:13.000Z | examples/domain_adaptation/digits/mdd.py | wuaodi/Transfer-Learning-Library | 29a946143e63b66a1da9ffa685bfe95f5640028a | [
"MIT"
] | null | null | null | examples/domain_adaptation/digits/mdd.py | wuaodi/Transfer-Learning-Library | 29a946143e63b66a1da9ffa685bfe95f5640028a | [
"MIT"
] | null | null | null | import random
import time
import warnings
import sys
import argparse
import shutil
import os.path as osp
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.optim import Adam
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
import torchvision.transfor... | 41.10089 | 120 | 0.637571 | import random
import time
import warnings
import sys
import argparse
import shutil
import os.path as osp
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.optim import Adam
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
import torchvision.transfor... | true | true |
1c37d528349c0e2504d4cd5a8e297d8f7bf3ae0e | 894 | py | Python | lib/btc.py | PiDisplay/PiDisplay | b0365ef76e24e7661ba5dcae48dcbb7262c3a57a | [
"MIT"
] | 3 | 2021-06-01T18:51:04.000Z | 2021-06-02T00:40:09.000Z | lib/btc.py | PiDisplay/PiDisplay | b0365ef76e24e7661ba5dcae48dcbb7262c3a57a | [
"MIT"
] | null | null | null | lib/btc.py | PiDisplay/PiDisplay | b0365ef76e24e7661ba5dcae48dcbb7262c3a57a | [
"MIT"
] | 2 | 2021-06-01T19:07:24.000Z | 2021-06-01T19:34:00.000Z | # A few basic helper functions for interfacing with Bitcoin Core
from os import getenv
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
class BtcRPC:
def __init__(self):
btcurl = "http://%s:%s@%s:%s" % (getenv('BITCOIN_RPC_USER'), getenv(
'BITCOIN_RPC_PASS'), getenv('BITCOIN... | 30.827586 | 82 | 0.674497 |
from os import getenv
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
class BtcRPC:
def __init__(self):
btcurl = "http://%s:%s@%s:%s" % (getenv('BITCOIN_RPC_USER'), getenv(
'BITCOIN_RPC_PASS'), getenv('BITCOIN_IP'), getenv('BITCOIN_RPC_PORT'))
self.connection = Aut... | true | true |
1c37d6d656cce791bd21776a49639d19298b0aaa | 245 | py | Python | BI-IOS/semester-project/webapp/beecon/campaigns/libs/cinemas/DataSource.py | josefdolezal/fit-cvut | 6b6abea4232b946246d33290718d6c5007926b63 | [
"MIT"
] | 20 | 2016-05-15T10:39:53.000Z | 2022-03-29T00:06:06.000Z | BI-IOS/semester-project/webapp/beecon/campaigns/libs/cinemas/DataSource.py | josefdolezal/fit-cvut | 6b6abea4232b946246d33290718d6c5007926b63 | [
"MIT"
] | 3 | 2017-05-27T16:44:01.000Z | 2019-01-02T21:02:59.000Z | BI-IOS/semester-project/webapp/beecon/campaigns/libs/cinemas/DataSource.py | josefdolezal/fit-cvut | 6b6abea4232b946246d33290718d6c5007926b63 | [
"MIT"
] | 11 | 2018-08-22T21:16:32.000Z | 2021-04-10T22:42:34.000Z | import requests
class CinemaCity:
def __init__( self, url ):
self._compile_url( url )
def movie_schedule( self ):
content = requests.get( self.url ).content
return content
def _compile_url( self, url ):
self.url = url
| 16.333333 | 46 | 0.669388 | import requests
class CinemaCity:
def __init__( self, url ):
self._compile_url( url )
def movie_schedule( self ):
content = requests.get( self.url ).content
return content
def _compile_url( self, url ):
self.url = url
| true | true |
1c37d8ccc994b2bd1d945e8270c804c1e0702049 | 182 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 14.6 Entity-Relationship Diagram
# Draw an entity-relationship diagram for database with companies, people, and professionals.
# professionals = people who work for companies
| 36.4 | 93 | 0.785714 | true | true | |
1c37da71d4bd83672d5725fe6e8e0b080dc05d5f | 20,444 | py | Python | monai/engines/evaluator.py | themantalope/MONAI | 9378e52b9c2283fa71cf8572b08f274071753053 | [
"Apache-2.0"
] | 3 | 2020-07-02T18:39:36.000Z | 2021-06-16T09:35:53.000Z | monai/engines/evaluator.py | themantalope/MONAI | 9378e52b9c2283fa71cf8572b08f274071753053 | [
"Apache-2.0"
] | 28 | 2020-06-26T12:47:52.000Z | 2020-09-08T00:33:42.000Z | monai/engines/evaluator.py | Nic-Ma/MONAI | f398298b5aadc076102261a687a158f6ac17ad1c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 51.496222 | 120 | 0.674134 |
from typing import TYPE_CHECKING, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union
import torch
from torch.utils.data import DataLoader
from monai.config import IgniteInfo
from monai.engines.utils import IterationEvents, default_metric_cmp_fn, default_prepare_batch
from monai.engines.workfl... | true | true |
1c37daaffae2c398d95511df9e2def643d477990 | 3,678 | py | Python | scripts/figure4/preprocessing_dream5_invitro.py | jiawu/Roller | a70e350905a59c2254dcefda7ab23c6417cf8f7d | [
"MIT"
] | null | null | null | scripts/figure4/preprocessing_dream5_invitro.py | jiawu/Roller | a70e350905a59c2254dcefda7ab23c6417cf8f7d | [
"MIT"
] | 2 | 2015-07-13T18:51:22.000Z | 2015-07-16T15:35:24.000Z | scripts/figure4/preprocessing_dream5_invitro.py | jiawu/Roller | a70e350905a59c2254dcefda7ab23c6417cf8f7d | [
"MIT"
] | null | null | null | import pandas as pd
import pdb
import scipy.stats as stats
def zscore_data(df):
p = df.values
z = pd.DataFrame(stats.zscore(p,axis=0,ddof=1),index=df.index, columns=df.columns)
z['Time'] = df['Time']
return(z)
db_path = '../data/invitro/net3_expression_data.tsv'
my_df = pd.read_csv(db_path, sep='\t')... | 43.270588 | 136 | 0.669657 | import pandas as pd
import pdb
import scipy.stats as stats
def zscore_data(df):
p = df.values
z = pd.DataFrame(stats.zscore(p,axis=0,ddof=1),index=df.index, columns=df.columns)
z['Time'] = df['Time']
return(z)
db_path = '../data/invitro/net3_expression_data.tsv'
my_df = pd.read_csv(db_path, sep='\t')... | true | true |
1c37dab1d05e53faea5ed821d46f44a67edb994a | 1,831 | py | Python | apps/users/admin.py | christianalcantara/book_backend | 5c98aad01a1ea7d7985cafa14c6de7eb3d0b48af | [
"MIT"
] | 1 | 2021-02-23T00:55:14.000Z | 2021-02-23T00:55:14.000Z | apps/users/admin.py | christianalcantara/book_backend | 5c98aad01a1ea7d7985cafa14c6de7eb3d0b48af | [
"MIT"
] | 1 | 2021-02-23T00:33:05.000Z | 2021-02-23T00:33:05.000Z | apps/users/admin.py | christianalcantara/book_backend | 5c98aad01a1ea7d7985cafa14c6de7eb3d0b48af | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Group
from apps.users.forms import UserChangeForm, UserCreationForm
from apps.users.models import User
class UserAdmin(BaseUserAdmin):
form = UserChangeForm
add_form = User... | 30.016393 | 77 | 0.534134 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Group
from apps.users.forms import UserChangeForm, UserCreationForm
from apps.users.models import User
class UserAdmin(BaseUserAdmin):
form = UserChangeForm
add_form = User... | true | true |
1c37dbc948feee822d32407b551e6cb846df0a97 | 8,535 | py | Python | gslib/addlhelp/encoding.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | 649 | 2015-01-08T01:50:15.000Z | 2022-03-31T08:33:38.000Z | gslib/addlhelp/encoding.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | 798 | 2015-01-02T07:46:09.000Z | 2022-03-31T20:37:19.000Z | gslib/addlhelp/encoding.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | 315 | 2015-01-02T10:26:53.000Z | 2022-03-27T02:18:58.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 49.051724 | 81 | 0.765436 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from gslib.help_provider import HelpProvider
_DETAILED_HELP_TEXT = ("""
<B>OVERVIEW</B>
To reduce the chance for `filename encoding interoperability pro... | true | true |
1c37dc2b9a245831e5c847624b92e7308a27130d | 151 | py | Python | rootfs/usr/lib/python3/dist-packages/numpy/distutils/compat.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | 343 | 2015-01-07T05:58:44.000Z | 2022-03-15T14:55:21.000Z | rootfs/usr/lib/python3/dist-packages/numpy/distutils/compat.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | 61 | 2015-03-19T18:20:21.000Z | 2019-10-23T12:58:23.000Z | rootfs/usr/lib/python3/dist-packages/numpy/distutils/compat.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | 66 | 2015-01-20T15:35:05.000Z | 2021-11-25T16:49:41.000Z | """Small modules to cope with python 2 vs 3 incompatibilities inside
numpy.distutils
"""
import sys
def get_exception():
return sys.exc_info()[1]
| 18.875 | 68 | 0.741722 | import sys
def get_exception():
return sys.exc_info()[1]
| true | true |
1c37dcad788bd730e9bf79ccc6bb167532afc494 | 2,963 | py | Python | Stage/backend/Datatables.py | zuoziji/transaction | 7a59817a699d9df32e13d43edda630520af7860d | [
"Apache-2.0"
] | null | null | null | Stage/backend/Datatables.py | zuoziji/transaction | 7a59817a699d9df32e13d43edda630520af7860d | [
"Apache-2.0"
] | 9 | 2021-02-08T20:19:53.000Z | 2022-03-11T23:16:46.000Z | Stage/backend/Datatables.py | zuoziji/transaction | 7a59817a699d9df32e13d43edda630520af7860d | [
"Apache-2.0"
] | 2 | 2019-03-03T14:27:54.000Z | 2019-07-22T09:00:35.000Z | # -*- coding: utf-8 -*-
from config_fh import get_db_engine
connection = get_db_engine().raw_connection()
cursor = connection.cursor()
class DataTablesServer(object):
def __init__(self, request, columns, index, table):
self.columns = columns
self.index = index
self.table = table
s... | 38.480519 | 114 | 0.585218 |
from config_fh import get_db_engine
connection = get_db_engine().raw_connection()
cursor = connection.cursor()
class DataTablesServer(object):
def __init__(self, request, columns, index, table):
self.columns = columns
self.index = index
self.table = table
self.request_values = re... | true | true |
1c37deb30c87f7186536d3181d22fa842c9470ef | 119 | py | Python | executiveorder/__init__.py | chrisengelsma/executive_orders | 5f0c7102b9abce3d44b54e5dd4c57bd0bb404037 | [
"MIT"
] | 2 | 2017-03-23T02:26:05.000Z | 2017-08-24T02:07:17.000Z | executiveorder/__init__.py | chrisengelsma/executive_orders | 5f0c7102b9abce3d44b54e5dd4c57bd0bb404037 | [
"MIT"
] | null | null | null | executiveorder/__init__.py | chrisengelsma/executive_orders | 5f0c7102b9abce3d44b54e5dd4c57bd0bb404037 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from executiveorder import *
from util import *
from processors import *
| 19.833333 | 28 | 0.697479 |
from executiveorder import *
from util import *
from processors import *
| true | true |
1c37df03de31a22741263c2f30a64b198279daf0 | 3,874 | py | Python | rs/localization_files/ES.py | alexander-marquardt/lexalink | d554f3a00699c8a4cdf1b28dd033655f929470fa | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-02-09T07:12:25.000Z | 2017-02-09T07:12:25.000Z | rs/localization_files/ES.py | alexander-marquardt/lexalink | d554f3a00699c8a4cdf1b28dd033655f929470fa | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | rs/localization_files/ES.py | alexander-marquardt/lexalink | d554f3a00699c8a4cdf1b28dd033655f929470fa | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
# LexaLink Copyright information - do not remove this copyright notice
# Copyright (C) 2012
#
# Lexalink - a free social network and dating platform for the Google App Engine.
#
# Original author: Alexander Marqu... | 29.12782 | 94 | 0.497935 | true | true | |
1c37e0871074573fc9ba5f909f00cc8a01fee8d8 | 37,881 | py | Python | thespian/system/admin/convention.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 71 | 2020-02-29T12:15:10.000Z | 2022-03-27T01:44:58.000Z | thespian/system/admin/convention.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 14 | 2020-10-07T08:34:29.000Z | 2022-03-27T01:44:41.000Z | thespian/system/admin/convention.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 15 | 2020-05-16T19:44:08.000Z | 2021-11-12T15:42:32.000Z | import logging
from thespian.actors import *
from thespian.system.utilis import (thesplog, checkActorCapabilities,
foldl, join, fmap, AssocList,
actualActorClass)
from thespian.system.timing import ExpirationTimer, currentTime
from thespian.system.... | 46.140073 | 113 | 0.619757 | import logging
from thespian.actors import *
from thespian.system.utilis import (thesplog, checkActorCapabilities,
foldl, join, fmap, AssocList,
actualActorClass)
from thespian.system.timing import ExpirationTimer, currentTime
from thespian.system.... | true | true |
1c37e09718c7c507edb9ccc628e2854c443d122d | 16,098 | py | Python | src/preprocess.py | zliucr/mixed-language-training | d61e767eb470d1f2a2272837bd4daff76c99854f | [
"MIT"
] | 28 | 2019-11-20T05:11:25.000Z | 2022-03-23T07:06:29.000Z | src/preprocess.py | zliucr/mixed-language-training | d61e767eb470d1f2a2272837bd4daff76c99854f | [
"MIT"
] | 5 | 2019-11-28T07:14:01.000Z | 2022-03-23T14:56:52.000Z | src/preprocess.py | zliucr/mixed-language-training | d61e767eb470d1f2a2272837bd4daff76c99854f | [
"MIT"
] | 5 | 2020-01-10T07:40:55.000Z | 2021-05-07T08:09:19.000Z |
from src.preparation import Vocab
from src.utils import binarize_nlu_data
from copy import deepcopy
import codecs
import json
import csv
import re
import string
import os
import pickle
import logging
logger = logging.getLogger()
def load_woz_data(file_path, language, dialogue_ontology, mapping=None):
"""
Th... | 40.651515 | 218 | 0.572742 |
from src.preparation import Vocab
from src.utils import binarize_nlu_data
from copy import deepcopy
import codecs
import json
import csv
import re
import string
import os
import pickle
import logging
logger = logging.getLogger()
def load_woz_data(file_path, language, dialogue_ontology, mapping=None):
with codec... | true | true |
1c37e25defe48454f8d5dd205faca99377110479 | 3,914 | py | Python | BackendBaggie/orders/views.py | Baggie-App/Updateapi | 80f200d7ffd4695e6348ce6bb9a7a31a6b821e77 | [
"MIT"
] | null | null | null | BackendBaggie/orders/views.py | Baggie-App/Updateapi | 80f200d7ffd4695e6348ce6bb9a7a31a6b821e77 | [
"MIT"
] | null | null | null | BackendBaggie/orders/views.py | Baggie-App/Updateapi | 80f200d7ffd4695e6348ce6bb9a7a31a6b821e77 | [
"MIT"
] | null | null | null | from orders.models import Order
from orders.serializers import OrderSerializer
from headers import *
from orders.permissions import CanCreatePermissionforCustomer,CanUpdateDeletePermissionforVendor
from rest_framework.decorators import api_view, permission_classes
#list retrive
class OrderListAPIView(generics.ListAPIV... | 30.578125 | 96 | 0.73071 | from orders.models import Order
from orders.serializers import OrderSerializer
from headers import *
from orders.permissions import CanCreatePermissionforCustomer,CanUpdateDeletePermissionforVendor
from rest_framework.decorators import api_view, permission_classes
class OrderListAPIView(generics.ListAPIView):
__ba... | true | true |
1c37e269d220c97cdae238d11121e1a04f05bdad | 11,267 | py | Python | sklearn/covariance/_empirical_covariance.py | JoElfner/scikit-learn | a538c37de8b7007250a296eddfb3bed6afabd500 | [
"BSD-3-Clause"
] | 1 | 2021-08-28T15:25:32.000Z | 2021-08-28T15:25:32.000Z | sklearn/covariance/_empirical_covariance.py | JoElfner/scikit-learn | a538c37de8b7007250a296eddfb3bed6afabd500 | [
"BSD-3-Clause"
] | null | null | null | sklearn/covariance/_empirical_covariance.py | JoElfner/scikit-learn | a538c37de8b7007250a296eddfb3bed6afabd500 | [
"BSD-3-Clause"
] | null | null | null | """
Maximum likelihood covariance estimator.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
# avoid division truncation
import warnings
import numpy as np
from scipy... | 33.041056 | 86 | 0.618088 |
import warnings
import numpy as np
from scipy import linalg
from .. import config_context
from ..base import BaseEstimator
from ..utils import check_array
from ..utils.extmath import fast_logdet
from ..metrics.pairwise import pairwise_distances
def log_likelihood(emp_cov, precision):
p = precision.shape[... | true | true |
1c37e27edfc4943fd7bb74198f2abf1fa0b756a5 | 22,624 | py | Python | rock4/common/p_common.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 5 | 2018-09-25T05:49:49.000Z | 2021-12-30T11:06:09.000Z | rock4/common/p_common.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 3 | 2018-04-01T04:27:21.000Z | 2019-01-03T11:02:33.000Z | rock4/common/p_common.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 7 | 2018-09-25T05:49:51.000Z | 2021-12-30T11:06:11.000Z | # -*- encoding: utf-8 -*-
'''
Current module: pyrunner.common
Rough version history:
v1.0 Original version to use
v2.0 Classify some useful functions
v2.1 define this module for common functions
v3.0 delete the class of WebBasic
use this module instead of the class named WebBasic ... | 34.278788 | 169 | 0.545748 |
'''
Current module: pyrunner.common
Rough version history:
v1.0 Original version to use
v2.0 Classify some useful functions
v2.1 define this module for common functions
v3.0 delete the class of WebBasic
use this module instead of the class named WebBasic
**********************... | false | true |
1c37e32bb445597a71ec273a75c015e77f9ac6e5 | 1,805 | py | Python | week05/Polynomials/polynomials.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | 4 | 2019-04-06T20:06:19.000Z | 2020-03-31T20:51:56.000Z | week05/Polynomials/polynomials.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | null | null | null | week05/Polynomials/polynomials.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | 1 | 2020-03-21T00:49:56.000Z | 2020-03-21T00:49:56.000Z | import sys
import re
class Monomial:
def __init__ (self, coefficient, power):
self.coefficient = coefficient
self.power = power
def calculate_derivative(self):
if self.power is not 0:
self.coefficient *= self.power
self.power -=1
if self.power == 0:
... | 31.12069 | 78 | 0.582271 | import sys
import re
class Monomial:
def __init__ (self, coefficient, power):
self.coefficient = coefficient
self.power = power
def calculate_derivative(self):
if self.power is not 0:
self.coefficient *= self.power
self.power -=1
if self.power == 0:
... | true | true |
1c37e36d659e4ac0d6d14021d0084265390a4ba3 | 1,309 | py | Python | minotor/api/projection_handler.py | datarmada/minotor | 06079926d717f0cd882152319aaeaa7edc9ba087 | [
"Apache-2.0"
] | 25 | 2020-04-11T17:51:31.000Z | 2022-03-21T16:26:36.000Z | minotor/api/projection_handler.py | datarmada/minotor | 06079926d717f0cd882152319aaeaa7edc9ba087 | [
"Apache-2.0"
] | 1 | 2022-02-28T04:07:01.000Z | 2022-02-28T04:07:01.000Z | minotor/api/projection_handler.py | datarmada/minotor | 06079926d717f0cd882152319aaeaa7edc9ba087 | [
"Apache-2.0"
] | null | null | null | import json
from tornado.escape import json_decode
from minotor.api.base_route import BaseRouteHandler
from minotor.encoders.json_encoder import ExtendedJSONEncoder
from minotor.data_managers.file_manager import FileManager
from minotor.statistics.projection import tsne_projector
class ProjectionHandler(BaseRouteHa... | 42.225806 | 110 | 0.663102 | import json
from tornado.escape import json_decode
from minotor.api.base_route import BaseRouteHandler
from minotor.encoders.json_encoder import ExtendedJSONEncoder
from minotor.data_managers.file_manager import FileManager
from minotor.statistics.projection import tsne_projector
class ProjectionHandler(BaseRouteHa... | true | true |
1c37e44056c8c8b12c54964949ff53fff6f44914 | 2,089 | py | Python | scripts/plotting/generate_table.py | ltiao/gp-dre | 5997a74826636a58662f5fa8c41a81d32ba8baa2 | [
"MIT"
] | null | null | null | scripts/plotting/generate_table.py | ltiao/gp-dre | 5997a74826636a58662f5fa8c41a81d32ba8baa2 | [
"MIT"
] | null | null | null | scripts/plotting/generate_table.py | ltiao/gp-dre | 5997a74826636a58662f5fa8c41a81d32ba8baa2 | [
"MIT"
] | 1 | 2021-11-10T00:52:11.000Z | 2021-11-10T00:52:11.000Z | import sys
import click
import pandas as pd
from conf import DATASET_PRETTY_NAMES, WEIGHT_PRETTY_NAMES
@click.command()
@click.argument("result", type=click.File('r'))
@click.argument("table", type=click.File('w'))
@click.option("--value", '-v', default="error")
@click.option("--index", '-i', default="name")
@click.... | 34.245902 | 83 | 0.618478 | import sys
import click
import pandas as pd
from conf import DATASET_PRETTY_NAMES, WEIGHT_PRETTY_NAMES
@click.command()
@click.argument("result", type=click.File('r'))
@click.argument("table", type=click.File('w'))
@click.option("--value", '-v', default="error")
@click.option("--index", '-i', default="name")
@click.... | true | true |
1c37e476eddadb3396d556671bb19e9bf56f2822 | 10,216 | py | Python | scripts/comparer.py | Chenger1/stellaris-trpack | 5d85bbbc7374975b5da729899b5691ea77c16ea2 | [
"MIT"
] | 3 | 2020-07-23T00:32:06.000Z | 2020-10-09T18:05:56.000Z | scripts/comparer.py | Chenger1/stellaris-trpack | 5d85bbbc7374975b5da729899b5691ea77c16ea2 | [
"MIT"
] | 105 | 2020-07-16T12:23:57.000Z | 2021-01-18T18:11:40.000Z | scripts/comparer.py | Chenger1/stellaris-trpack | 5d85bbbc7374975b5da729899b5691ea77c16ea2 | [
"MIT"
] | 1 | 2020-07-15T13:30:57.000Z | 2020-07-15T13:30:57.000Z | """
↓ Инициализация данных ↓
"""
from os import path, mkdir
from scripts.utils import local_mod_path
from copy import copy
from typing import Union, Tuple
from scripts.stack import Stack, NameListElement, LastParentStack
"""
↓ Сохранение завершенной локали... | 42.74477 | 121 | 0.532792 |
from os import path, mkdir
from scripts.utils import local_mod_path
from copy import copy
from typing import Union, Tuple
from scripts.stack import Stack, NameListElement, LastParentStack
def put_lines(file):
localisation_path_list = file.original_file_path.split(f'{file.mod_id}\\')[-1].split('\\')[0:-2]
... | true | true |
1c37e4a671bc325ced27e030ace6a98fc1bdd59e | 3,559 | py | Python | tensorflow/examples/get_started/regression/test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/examples/get_started/regression/test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/examples/get_started/regression/test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2016 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... | 39.544444 | 138 | 0.744591 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import pandas as pd
from six.moves import StringIO
import tensorflow.examples.get_started.regression.imports85 as imports85
sys.modules["imports85"] = imports85
import tensorflow... | true | true |
1c37e5fbdebd8e4a3070648f16226aee72a79b2f | 974 | py | Python | guild/commands/remotes.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | null | null | null | guild/commands/remotes.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | null | null | null | guild/commands/remotes.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2022 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 24.974359 | 74 | 0.755647 |
from __future__ import absolute_import
from __future__ import division
import click
from guild import click_util
from . import remote_support
@click.command()
@click_util.render_doc
def remotes():
from . import remotes_impl
remotes_impl.main()
| true | true |
1c37e7dbb021610a7eec1d4cac9335f3331d5cf7 | 79 | py | Python | py-work/pipeline/tokenizer.py | msaidzengin/KontroleDegerMi | a14799e1076e018872d09e449c991ce3548a56cd | [
"Apache-2.0"
] | 3 | 2019-11-18T12:34:37.000Z | 2021-02-28T21:37:42.000Z | py-work/pipeline/tokenizer.py | msaidzengin/KontroleDegerMi | a14799e1076e018872d09e449c991ce3548a56cd | [
"Apache-2.0"
] | null | null | null | py-work/pipeline/tokenizer.py | msaidzengin/KontroleDegerMi | a14799e1076e018872d09e449c991ce3548a56cd | [
"Apache-2.0"
] | 3 | 2019-09-15T13:44:19.000Z | 2020-02-04T16:06:23.000Z | import nltk
def tokenize(text):
return nltk.word_tokenize(text, 'turkish') | 19.75 | 46 | 0.746835 | import nltk
def tokenize(text):
return nltk.word_tokenize(text, 'turkish') | true | true |
1c37e8e92759ddc834020ce00cb744fd0f0d2997 | 28,407 | py | Python | dowhy/causal_refuters/dummy_outcome_refuter.py | t-triobox/dowhy | 77906cd4edff2749683eb4b2f1ab91213e38ec9c | [
"MIT"
] | 840 | 2018-06-25T22:31:16.000Z | 2019-05-06T13:45:17.000Z | dowhy/causal_refuters/dummy_outcome_refuter.py | t-triobox/dowhy | 77906cd4edff2749683eb4b2f1ab91213e38ec9c | [
"MIT"
] | 51 | 2018-07-05T09:31:59.000Z | 2019-05-03T15:37:10.000Z | dowhy/causal_refuters/dummy_outcome_refuter.py | t-triobox/dowhy | 77906cd4edff2749683eb4b2f1ab91213e38ec9c | [
"MIT"
] | 106 | 2018-06-28T12:35:03.000Z | 2019-05-06T16:16:32.000Z | import copy
import math
import numpy as np
import pandas as pd
import logging
import pdb
from collections import OrderedDict, namedtuple
from dowhy.causal_refuter import CausalRefutation
from dowhy.causal_refuter import CausalRefuter
from dowhy.causal_estimator import CausalEstimator,CausalEstimate
from sklearn.linear... | 47.662752 | 196 | 0.655824 | import copy
import math
import numpy as np
import pandas as pd
import logging
import pdb
from collections import OrderedDict, namedtuple
from dowhy.causal_refuter import CausalRefutation
from dowhy.causal_refuter import CausalRefuter
from dowhy.causal_estimator import CausalEstimator,CausalEstimate
from sklearn.linear... | true | true |
1c37e949e26182a0b9e6fe6ac19d70d6b2de2d73 | 2,968 | py | Python | configs/vfnet/vfnet_r2_101_fpn_mdconv_c3-c5_mstrain_2x_coco_cate3.py | hanchenchen/VarifocalNet | 78bcdf6877db8a8ddbd71ae92c38a976ad1fc704 | [
"Apache-2.0"
] | null | null | null | configs/vfnet/vfnet_r2_101_fpn_mdconv_c3-c5_mstrain_2x_coco_cate3.py | hanchenchen/VarifocalNet | 78bcdf6877db8a8ddbd71ae92c38a976ad1fc704 | [
"Apache-2.0"
] | null | null | null | configs/vfnet/vfnet_r2_101_fpn_mdconv_c3-c5_mstrain_2x_coco_cate3.py | hanchenchen/VarifocalNet | 78bcdf6877db8a8ddbd71ae92c38a976ad1fc704 | [
"Apache-2.0"
] | null | null | null | _base_ = './vfnet_r50_fpn_mdconv_c3-c5_mstrain_2x_coco.py'
model = dict(
pretrained='open-mmlab://res2net101_v1d_26w_4s',
backbone=dict(
type='Res2Net',
depth=101,
scales=4,
base_width=26,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
no... | 31.913978 | 94 | 0.62938 | _base_ = './vfnet_r50_fpn_mdconv_c3-c5_mstrain_2x_coco.py'
model = dict(
pretrained='open-mmlab://res2net101_v1d_26w_4s',
backbone=dict(
type='Res2Net',
depth=101,
scales=4,
base_width=26,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
no... | true | true |
1c37e9ac7fc3e709da3c94c51fd907c758367913 | 4,116 | py | Python | getCmpLogicMasking.py | DependableSystemsLab/GPU-Trident | c734cd8a18146869fc915af73a6ca13ceca35c0b | [
"MIT"
] | 1 | 2021-01-17T10:36:21.000Z | 2021-01-17T10:36:21.000Z | getCmpLogicMasking.py | DependableSystemsLab/GPU-Trident | c734cd8a18146869fc915af73a6ca13ceca35c0b | [
"MIT"
] | null | null | null | getCmpLogicMasking.py | DependableSystemsLab/GPU-Trident | c734cd8a18146869fc915af73a6ca13ceca35c0b | [
"MIT"
] | null | null | null | #! /usr/bin/python
import subprocess, os, sys
####################################################################
src_name = sys.argv[1]
targetCmpIndex = int(sys.argv[2])
####################################################################
ltCmpList = []
storeMaskingMap = {}
if_cmp = False
# Read "loop_terminatin... | 28.583333 | 219 | 0.608844 |
import subprocess, os, sys
| true | true |
1c37e9f73a9218b7227d08cc2e8341fe3692bd34 | 1,461 | py | Python | mandos/search/pubchem/dgidb_search.py | dmyersturnbull/chembler | b1b54a5f4fe7939e012c0cc8b227fcea60d6e744 | [
"Apache-2.0"
] | null | null | null | mandos/search/pubchem/dgidb_search.py | dmyersturnbull/chembler | b1b54a5f4fe7939e012c0cc8b227fcea60d6e744 | [
"Apache-2.0"
] | null | null | null | mandos/search/pubchem/dgidb_search.py | dmyersturnbull/chembler | b1b54a5f4fe7939e012c0cc8b227fcea60d6e744 | [
"Apache-2.0"
] | null | null | null | from typing import Sequence
from mandos.model.apis.pubchem_api import PubchemApi
from mandos.model.concrete_hits import DgiHit
from mandos.search.pubchem import PubchemSearch
class DgiSearch(PubchemSearch[DgiHit]):
""" """
def __init__(self, key: str, api: PubchemApi):
super().__init__(key, api)
... | 34.785714 | 85 | 0.559206 | from typing import Sequence
from mandos.model.apis.pubchem_api import PubchemApi
from mandos.model.concrete_hits import DgiHit
from mandos.search.pubchem import PubchemSearch
class DgiSearch(PubchemSearch[DgiHit]):
def __init__(self, key: str, api: PubchemApi):
super().__init__(key, api)
def find(s... | true | true |
1c37ec9fe6825cc352f2e173037d792b57bbdcde | 12,606 | py | Python | mapclientplugins/scaffoldrigidalignerstep/view/scaffoldrigidalignerwidget.py | mahyar-osn/mapclientplugins.scaffoldrigidalignerstep | 7c5fd754fba4778e59a743ea03c47c920df26827 | [
"Apache-2.0"
] | null | null | null | mapclientplugins/scaffoldrigidalignerstep/view/scaffoldrigidalignerwidget.py | mahyar-osn/mapclientplugins.scaffoldrigidalignerstep | 7c5fd754fba4778e59a743ea03c47c920df26827 | [
"Apache-2.0"
] | null | null | null | mapclientplugins/scaffoldrigidalignerstep/view/scaffoldrigidalignerwidget.py | mahyar-osn/mapclientplugins.scaffoldrigidalignerstep | 7c5fd754fba4778e59a743ea03c47c920df26827 | [
"Apache-2.0"
] | null | null | null | from PySide import QtGui
from .ui_scaffoldrigidalignerwidget import Ui_ScaffoldRigidAlignerWidget
from opencmiss.zinchandlers.scenemanipulation import SceneManipulation
from opencmiss.zincwidgets.basesceneviewerwidget import BaseSceneviewerWidget
class ScaffoldRigidAlignerWidget(QtGui.QWidget):
def __init__(se... | 41.741722 | 103 | 0.698398 | from PySide import QtGui
from .ui_scaffoldrigidalignerwidget import Ui_ScaffoldRigidAlignerWidget
from opencmiss.zinchandlers.scenemanipulation import SceneManipulation
from opencmiss.zincwidgets.basesceneviewerwidget import BaseSceneviewerWidget
class ScaffoldRigidAlignerWidget(QtGui.QWidget):
def __init__(se... | true | true |
1c37ed23465942e2c0de741b7ff5ccc1455f86ac | 7,281 | py | Python | imgHide++/imghide++.py | AJD-/Stego-Examples | 26bc9b1c1bf2d52c96818eaf10e07ed2111d47f9 | [
"Apache-2.0"
] | null | null | null | imgHide++/imghide++.py | AJD-/Stego-Examples | 26bc9b1c1bf2d52c96818eaf10e07ed2111d47f9 | [
"Apache-2.0"
] | null | null | null | imgHide++/imghide++.py | AJD-/Stego-Examples | 26bc9b1c1bf2d52c96818eaf10e07ed2111d47f9 | [
"Apache-2.0"
] | null | null | null | from PIL import Image
import sys
import os
import random
import math
import secrets
from base64 import b64encode
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from bitstring import BitArray
def main():
global maxLenChar, maxLenBits
# Clear screen lambda function
cls = lambda: os.system(... | 37.530928 | 139 | 0.514352 | from PIL import Image
import sys
import os
import random
import math
import secrets
from base64 import b64encode
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from bitstring import BitArray
def main():
global maxLenChar, maxLenBits
cls = lambda: os.system('cls' if os.name=='nt' else 'c... | true | true |
1c37edc31b7975955d1a8b592b54e5c555a2a1e0 | 357 | py | Python | tests/test013.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 739 | 2015-01-01T02:05:11.000Z | 2022-03-30T15:26:16.000Z | tests/test013.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 33 | 2015-03-25T23:17:04.000Z | 2021-08-19T08:25:22.000Z | tests/test013.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 167 | 2015-01-01T22:27:47.000Z | 2022-03-17T13:29:19.000Z | import DOM
class FocusWidget:
def __init__(self, element):
self.clickListeners = []
def addClickListener(self, listener):
self.clickListeners.append(listener)
def onBrowserEvent(self, event):
if DOM.eventGetType(event) == Event.ONCLICK:
for listener in self.clickListe... | 23.8 | 52 | 0.647059 | import DOM
class FocusWidget:
def __init__(self, element):
self.clickListeners = []
def addClickListener(self, listener):
self.clickListeners.append(listener)
def onBrowserEvent(self, event):
if DOM.eventGetType(event) == Event.ONCLICK:
for listener in self.clickListe... | true | true |
1c37ee469792f730b1f00b88f8356f98b5ca334f | 162 | py | Python | PYDAQ-0.1/gui/terminator.py | simschmid/pydaqt | cac1580b1eb955968d6db9787a55a4c4f1b12d61 | [
"MIT"
] | null | null | null | PYDAQ-0.1/gui/terminator.py | simschmid/pydaqt | cac1580b1eb955968d6db9787a55a4c4f1b12d61 | [
"MIT"
] | null | null | null | PYDAQ-0.1/gui/terminator.py | simschmid/pydaqt | cac1580b1eb955968d6db9787a55a4c4f1b12d61 | [
"MIT"
] | null | null | null | '''
Created on 27.10.2016
@author: simon
'''
terminatehooks=[]
def run_terminatehooks():
print "running termination methods"
for h in terminatehooks: h() | 18 | 39 | 0.703704 | '''
Created on 27.10.2016
@author: simon
'''
terminatehooks=[]
def run_terminatehooks():
print "running termination methods"
for h in terminatehooks: h() | false | true |
1c37eeee313d0653cf6b114df974b6e4a57dcf65 | 3,020 | py | Python | beep/tests/test_principal_components.py | moorepatrick/beep | c54b80d1afb5b175bd9335481efc2474a4317c47 | [
"Apache-2.0"
] | 17 | 2020-06-23T17:39:29.000Z | 2022-02-20T07:39:34.000Z | beep/tests/test_principal_components.py | moorepatrick/beep | c54b80d1afb5b175bd9335481efc2474a4317c47 | [
"Apache-2.0"
] | null | null | null | beep/tests/test_principal_components.py | moorepatrick/beep | c54b80d1afb5b175bd9335481efc2474a4317c47 | [
"Apache-2.0"
] | 5 | 2020-07-24T13:12:06.000Z | 2022-03-07T05:53:29.000Z | # Copyright 2019 Toyota Research Institute. All rights reserved.
import json
import os
import unittest
import numpy as np
from sklearn.decomposition import PCA
from beep.principal_components import PrincipalComponents, pivot_data
TEST_DIR = os.path.dirname(__file__)
TEST_FILE_DIR = os.path.join(TEST_DIR, "test_files")... | 39.736842 | 109 | 0.679801 |
import json
import os
import unittest
import numpy as np
from sklearn.decomposition import PCA
from beep.principal_components import PrincipalComponents, pivot_data
TEST_DIR = os.path.dirname(__file__)
TEST_FILE_DIR = os.path.join(TEST_DIR, "test_files")
class PrincipalComponentsTest(unittest.TestCase):
def set... | true | true |
1c37eefef7e9572a00fb3c774e3540d8b35ceb83 | 7,449 | py | Python | Projects/1_Sudoku/solution.py | aanzolaavila/aind-projects | 3b1a1f6e0199dc6033b2183f25afb456e53751ce | [
"MIT"
] | null | null | null | Projects/1_Sudoku/solution.py | aanzolaavila/aind-projects | 3b1a1f6e0199dc6033b2183f25afb456e53751ce | [
"MIT"
] | null | null | null | Projects/1_Sudoku/solution.py | aanzolaavila/aind-projects | 3b1a1f6e0199dc6033b2183f25afb456e53751ce | [
"MIT"
] | null | null | null | import copy
from utils import *
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC', 'DEF', 'GHI') for cs in ('123', '456', '789')]
unitlist = row_units + column_units + square_units
diagonal_units = [[a + b for a, b in zip('ABCDEFGHI... | 32.246753 | 113 | 0.645322 | import copy
from utils import *
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC', 'DEF', 'GHI') for cs in ('123', '456', '789')]
unitlist = row_units + column_units + square_units
diagonal_units = [[a + b for a, b in zip('ABCDEFGHI... | true | true |
1c37f02e47f46e95b61c313a193b703b8bc6a892 | 2,212 | py | Python | mmedit/datasets/sr_facial_landmark_dataset.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 1 | 2021-07-20T08:20:04.000Z | 2021-07-20T08:20:04.000Z | mmedit/datasets/sr_facial_landmark_dataset.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 1 | 2021-08-05T16:20:39.000Z | 2021-08-05T16:20:39.000Z | mmedit/datasets/sr_facial_landmark_dataset.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 2 | 2021-12-26T16:23:09.000Z | 2021-12-28T03:44:10.000Z | import os.path as osp
import numpy as np
from .base_sr_dataset import BaseSRDataset
from .registry import DATASETS
@DATASETS.register_module()
class SRFacialLandmarkDataset(BaseSRDataset):
"""Facial image and landmark dataset with an annotation file for image
restoration.
The dataset loads gt (Ground-T... | 34.5625 | 78 | 0.651899 | import os.path as osp
import numpy as np
from .base_sr_dataset import BaseSRDataset
from .registry import DATASETS
@DATASETS.register_module()
class SRFacialLandmarkDataset(BaseSRDataset):
def __init__(self, gt_folder, ann_file, pipeline, scale, test_mode=False):
super().__init__(pipeline, scale, test_... | true | true |
1c37f0cd29bf48ab95bf22b437e1c701e9ac98d4 | 195 | py | Python | scripts/deploy_counter.py | PatrickAlphaC/xDai-brownie | 91e50772716fe349cc15645450af5c1ed9bf1d55 | [
"MIT"
] | 2 | 2021-02-25T23:12:40.000Z | 2021-03-17T19:55:07.000Z | scripts/deploy_counter.py | PatrickAlphaC/xDai-brownie | 91e50772716fe349cc15645450af5c1ed9bf1d55 | [
"MIT"
] | null | null | null | scripts/deploy_counter.py | PatrickAlphaC/xDai-brownie | 91e50772716fe349cc15645450af5c1ed9bf1d55 | [
"MIT"
] | 2 | 2021-01-19T08:53:14.000Z | 2021-04-12T08:36:20.000Z | #!/usr/bin/python3
import os
from brownie import Counter, accounts, config
def main():
dev = accounts.add(os.getenv(config['wallets']['from_key']))
return Counter.deploy({'from': dev})
| 21.666667 | 64 | 0.692308 |
import os
from brownie import Counter, accounts, config
def main():
dev = accounts.add(os.getenv(config['wallets']['from_key']))
return Counter.deploy({'from': dev})
| true | true |
1c37f13b750016fa9c175946d0bdb07a2c1b3a89 | 3,873 | py | Python | vk_bot.py | aevtikheev/quiz_bot | 2d2909736775afb4493cd0640cf27f40f89fe9f3 | [
"MIT"
] | null | null | null | vk_bot.py | aevtikheev/quiz_bot | 2d2909736775afb4493cd0640cf27f40f89fe9f3 | [
"MIT"
] | null | null | null | vk_bot.py | aevtikheev/quiz_bot | 2d2909736775afb4493cd0640cf27f40f89fe9f3 | [
"MIT"
] | null | null | null | """VK version of Quiz Bot."""
from redis import Redis
from vk_api import VkApi
from vk_api.longpoll import VkLongPoll, VkEventType, Event
from vk_api.vk_api import VkApiMethod
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from env_settings import env_settings
from quest... | 33.973684 | 97 | 0.696101 | from redis import Redis
from vk_api import VkApi
from vk_api.longpoll import VkLongPoll, VkEventType, Event
from vk_api.vk_api import VkApiMethod
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from env_settings import env_settings
from questions import QuizDB, is_correct... | true | true |
1c37f1af7831898bfa93304aca25edbefa2bf539 | 1,175 | py | Python | gumroad_clone/users/tests/test_forms.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | 1 | 2022-01-22T13:43:30.000Z | 2022-01-22T13:43:30.000Z | gumroad_clone/users/tests/test_forms.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | gumroad_clone/users/tests/test_forms.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | """
Module for all Form Tests.
"""
import pytest
from django.utils.translation import gettext_lazy as _
from gumroad_clone.users.forms import UserCreationForm
from gumroad_clone.users.models import User
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
"""
Test class for all tests related to th... | 29.375 | 87 | 0.63234 | import pytest
from django.utils.translation import gettext_lazy as _
from gumroad_clone.users.forms import UserCreationForm
from gumroad_clone.users.models import User
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_username_validation_error_msg(self, user: User):
... | true | true |
1c37f1ceed2be005d0a908561228e8a8a445d658 | 3,311 | py | Python | rover/ball_tracking.py | pvrohin/Rover | 7b84aec32b38cff273c6174872ecf3344d7d1919 | [
"MIT"
] | null | null | null | rover/ball_tracking.py | pvrohin/Rover | 7b84aec32b38cff273c6174872ecf3344d7d1919 | [
"MIT"
] | null | null | null | rover/ball_tracking.py | pvrohin/Rover | 7b84aec32b38cff273c6174872ecf3344d7d1919 | [
"MIT"
] | null | null | null | # USAGE
# python ball_tracking.py --video ball_tracking_example.mp4
# python ball_tracking.py
# import the necessary packages
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument... | 29.5625 | 105 | 0.700091 |
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video",
help="path to the (optional) video file")
ap.add_argument("-b", "--buffer", type=int, default=64,
help="max buffer size")
args = vars(ap.parse_args())
g... | true | true |
1c37f23d5fa15f149834f3ac1de5656f03b2c04b | 1,098 | py | Python | psh-script.py | yarray/fake-xcat | e5b2c0f64a55b185f3c5f84300f96f6ea85557df | [
"MIT"
] | 1 | 2016-08-04T18:45:49.000Z | 2016-08-04T18:45:49.000Z | psh-script.py | yarray/fake-xcat | e5b2c0f64a55b185f3c5f84300f96f6ea85557df | [
"MIT"
] | null | null | null | psh-script.py | yarray/fake-xcat | e5b2c0f64a55b185f3c5f84300f96f6ea85557df | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import args
import os
import sys
from fabric.operations import run, env, put
from fabric.main import main
from fabric.context_managers import hide, settings
from fabric.contrib.files import exists
env.user = args.user()
env.password = args.password()
temp_dir = '/tmp/'
def task(script, param... | 25.534884 | 77 | 0.591985 |
import args
import os
import sys
from fabric.operations import run, env, put
from fabric.main import main
from fabric.context_managers import hide, settings
from fabric.contrib.files import exists
env.user = args.user()
env.password = args.password()
temp_dir = '/tmp/'
def task(script, params):
with hide('ou... | false | true |
1c37f2a6a12804c5bbbf6556acc243bbfee5de70 | 6,282 | py | Python | ics/structures/st_chip_versions.py | intrepidcs/python_ics | 7bfa8c2f893763608f9255f9536a2019cfae0c23 | [
"Unlicense"
] | 45 | 2017-10-17T08:42:08.000Z | 2022-02-21T16:26:48.000Z | ics/structures/st_chip_versions.py | intrepidcs/python_ics | 7bfa8c2f893763608f9255f9536a2019cfae0c23 | [
"Unlicense"
] | 106 | 2017-03-07T21:10:39.000Z | 2022-03-29T15:32:46.000Z | ics/structures/st_chip_versions.py | intrepidcs/python_ics | 7bfa8c2f893763608f9255f9536a2019cfae0c23 | [
"Unlicense"
] | 17 | 2017-04-04T12:30:22.000Z | 2022-01-28T05:30:25.000Z | # This file was auto generated; Do not modify, if you value your sanity!
import ctypes
import enum
class fire_versions(ctypes.Structure):
_pack_ = 2
_fields_ = [
('mpic_maj', ctypes.c_uint8),
('mpic_min', ctypes.c_uint8),
('upic_maj', ctypes.c_uint8),
('upic_min', ctypes.c_uin... | 22.76087 | 72 | 0.622254 |
import ctypes
import enum
class fire_versions(ctypes.Structure):
_pack_ = 2
_fields_ = [
('mpic_maj', ctypes.c_uint8),
('mpic_min', ctypes.c_uint8),
('upic_maj', ctypes.c_uint8),
('upic_min', ctypes.c_uint8),
('lpic_maj', ctypes.c_uint8),
('lpic_min', ctypes.c... | true | true |
1c37f4307c1fedd80d147e00179c58c2aeb6612a | 3,496 | py | Python | python/assign_user_to_org_role.py | stevenctong/rubrik | 89e20799a998943811db615ad49f64a26929f423 | [
"MIT"
] | 4 | 2020-12-31T21:53:53.000Z | 2022-03-24T03:02:25.000Z | python/assign_user_to_org_role.py | stevenctong/rubrik | 89e20799a998943811db615ad49f64a26929f423 | [
"MIT"
] | null | null | null | python/assign_user_to_org_role.py | stevenctong/rubrik | 89e20799a998943811db615ad49f64a26929f423 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# https://build.rubrik.com
# https://github.com/rubrikinc/rubrik-sdk-for-python
# Title: assign_user_to_org_role.py
# Description: Assigns a Rubrik user to an organization role
# Author: Steven Tong
# GitHub: stevenctong
# Date: 5/4/21
import rubrik_cdm
import urllib3
# Use to import Rubrik lo... | 32.37037 | 110 | 0.69365 |
import rubrik_cdm
import urllib3
urllib3.disable_warnings()
node_ip = ""
username = ""
password = ""
username = ""
org_name = ""
org_role = ""
rubrik = rubrik_cdm.Connect(node_ip, username, password)
ldap_service = rubrik.get('v1', '/ldap_service')
ldap_data = ldap_service['data']
username_sp... | true | true |
1c37f4d127a520e1151bfd13ef3e22bfa8b4283d | 1,120 | py | Python | lib/atari/state_processor.py | Edadeal/deephack-rl | 86f13be19f5650b9acc9dd3b82ea5637418c7ad3 | [
"MIT"
] | null | null | null | lib/atari/state_processor.py | Edadeal/deephack-rl | 86f13be19f5650b9acc9dd3b82ea5637418c7ad3 | [
"MIT"
] | null | null | null | lib/atari/state_processor.py | Edadeal/deephack-rl | 86f13be19f5650b9acc9dd3b82ea5637418c7ad3 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
class StateProcessor():
"""
Processes a raw Atari iamges. Resizes it and converts it to grayscale.
"""
def __init__(self):
# Build the Tensorflow graph
with tf.variable_scope("state_processor"):
self.input_state = tf.placeholder(
... | 33.939394 | 85 | 0.599107 | import numpy as np
import tensorflow as tf
class StateProcessor():
def __init__(self):
with tf.variable_scope("state_processor"):
self.input_state = tf.placeholder(
shape=[210, 160, 3], dtype=tf.uint8)
self.output = tf.image.rgb_to_grayscale(self.input_sta... | true | true |
1c37f5c549e1dac8ea0ba970954be03eefadf2ed | 2,070 | py | Python | mesonbuild/scripts/commandrunner.py | NNemec/meson | d72a5c14f83253bafaf6b2531442d981ea1df2ed | [
"Apache-2.0"
] | 1 | 2019-08-16T16:25:12.000Z | 2019-08-16T16:25:12.000Z | mesonbuild/scripts/commandrunner.py | NNemec/meson | d72a5c14f83253bafaf6b2531442d981ea1df2ed | [
"Apache-2.0"
] | null | null | null | mesonbuild/scripts/commandrunner.py | NNemec/meson | d72a5c14f83253bafaf6b2531442d981ea1df2ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2014 The Meson development team
# 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 appl... | 34.5 | 89 | 0.68744 |
import sys, os, subprocess, shutil
def run_command(source_dir, build_dir, subdir, command, arguments):
env = {'MESON_SOURCE_ROOT' : source_dir,
'MESON_BUILD_ROOT' : build_dir,
'MESON_SUBDIR' : subdir
}
cwd = os.path.join(source_dir, subdir)
child_env = os.en... | true | true |
1c37f68eba5826067ac62bbbd368c2e6261a9be9 | 1,400 | py | Python | surveytools/__init__.py | barentsen/vphastools | 214ddea35d2628034c236c5647a977fc2bad6572 | [
"MIT"
] | null | null | null | surveytools/__init__.py | barentsen/vphastools | 214ddea35d2628034c236c5647a977fc2bad6572 | [
"MIT"
] | 8 | 2015-05-18T16:31:28.000Z | 2017-10-17T05:25:37.000Z | surveytools/__init__.py | barentsen/vphastools | 214ddea35d2628034c236c5647a977fc2bad6572 | [
"MIT"
] | 4 | 2016-05-13T14:23:25.000Z | 2019-12-02T05:13:58.000Z | from __future__ import absolute_import
import os
# Use Agg if no DISPLAY is available
DISPLAY = os.environ.get('DISPLAY')
if DISPLAY is None or DISPLAY.startswith('localhost'):
import matplotlib
matplotlib.use('Agg')
###########
# CONSTANTS
###########
# Where are VPHAS reduced images and calibration frames... | 35 | 74 | 0.668571 | from __future__ import absolute_import
import os
DISPLAY = os.environ.get('DISPLAY')
if DISPLAY is None or DISPLAY.startswith('localhost'):
import matplotlib
matplotlib.use('Agg')
', 'r', 'i']
SURVEYTOOLS_PATH = os.path.abspath(os.path.dirname(__file__))
SURVEYTOOLS_DATA = os.path.join(SURVEYTOOLS_PATH, '... | true | true |
1c37f6d5759aa1b5897ab68580f514851e24c730 | 13,776 | py | Python | checker.py | EmiliaDevs/HotstarChecker | 9935ec45edc365e91840ad581560be64f35a6f8c | [
"MIT"
] | 9 | 2021-03-07T14:36:22.000Z | 2021-08-02T16:32:43.000Z | checker.py | Keys-007/HotstarChecker | 9935ec45edc365e91840ad581560be64f35a6f8c | [
"MIT"
] | null | null | null | checker.py | Keys-007/HotstarChecker | 9935ec45edc365e91840ad581560be64f35a6f8c | [
"MIT"
] | 7 | 2021-03-07T14:39:35.000Z | 2022-01-22T16:28:18.000Z | import requests
import json
import re
import sys
import os
import asyncio
from io import BytesIO
from pyrogram import Client, filters, idle
from pyrogram import __version__
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
from pyrogram.errors import UserNotParticipant, FloodWait, ChatAdmi... | 49.376344 | 248 | 0.551394 | import requests
import json
import re
import sys
import os
import asyncio
from io import BytesIO
from pyrogram import Client, filters, idle
from pyrogram import __version__
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
from pyrogram.errors import UserNotParticipant, FloodWait, ChatAdmi... | true | true |
1c37f76343bf1d2e443bbd7dd15abdfcf9663879 | 482 | py | Python | cbuild/hooks/pre_configure/01_override_guess.py | wezm/cports | 0d901c424cbcd663b6d0a2ce9803143a63db40b5 | [
"BSD-2-Clause"
] | null | null | null | cbuild/hooks/pre_configure/01_override_guess.py | wezm/cports | 0d901c424cbcd663b6d0a2ce9803143a63db40b5 | [
"BSD-2-Clause"
] | null | null | null | cbuild/hooks/pre_configure/01_override_guess.py | wezm/cports | 0d901c424cbcd663b6d0a2ce9803143a63db40b5 | [
"BSD-2-Clause"
] | null | null | null | from cbuild.core import paths
import shutil
def invoke(pkg):
if not pkg.build_style or pkg.build_style != "gnu_configure":
return
for f in pkg.abs_wrksrc.rglob("*config*.*"):
if f.is_symlink():
continue
if f.suffix == ".guess":
f.unlink()
shutil.cop... | 26.777778 | 65 | 0.556017 | from cbuild.core import paths
import shutil
def invoke(pkg):
if not pkg.build_style or pkg.build_style != "gnu_configure":
return
for f in pkg.abs_wrksrc.rglob("*config*.*"):
if f.is_symlink():
continue
if f.suffix == ".guess":
f.unlink()
shutil.cop... | true | true |
1c37f7731e03aa6c8b5e3fdf43dcb61912bc9bdb | 10,571 | py | Python | neural/models.py | ipavlopoulos/lm | b9ad7d98be47c0f1a6b446a090d1fce488bb2e3f | [
"Apache-2.0"
] | null | null | null | neural/models.py | ipavlopoulos/lm | b9ad7d98be47c0f1a6b446a090d1fce488bb2e3f | [
"Apache-2.0"
] | 5 | 2020-02-11T21:23:02.000Z | 2022-02-10T02:04:14.000Z | neural/models.py | ipavlopoulos/lm | b9ad7d98be47c0f1a6b446a090d1fce488bb2e3f | [
"Apache-2.0"
] | 1 | 2020-09-25T15:47:08.000Z | 2020-09-25T15:47:08.000Z | import numpy as np
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential
from tensorflow.keras.layer... | 44.603376 | 139 | 0.642796 | import numpy as np
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential
from tensorflow.keras.layer... | true | true |
1c37f7cd5825758bf9268df6fa253c9ebf526fb7 | 16,257 | py | Python | python/ray/tune/experiment.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/experiment.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/experiment.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2022-03-24T22:48:21.000Z | 2022-03-24T22:48:21.000Z | import copy
from functools import partial
import grpc
import inspect
import logging
import os
from pathlib import Path
from pickle import PicklingError
import traceback
from typing import Any, Dict, Optional, Sequence
from ray.tune.error import TuneError
from ray.tune.registry import register_trainable
from ray.tune.r... | 35.72967 | 87 | 0.596974 | import copy
from functools import partial
import grpc
import inspect
import logging
import os
from pathlib import Path
from pickle import PicklingError
import traceback
from typing import Any, Dict, Optional, Sequence
from ray.tune.error import TuneError
from ray.tune.registry import register_trainable
from ray.tune.r... | true | true |
1c37f7e1fb26d8ea5349fedd3a60f566d09cf598 | 10,488 | py | Python | tests/test_constraints.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 16,259 | 2018-05-02T02:31:30.000Z | 2022-03-31T21:50:23.000Z | tests/test_constraints.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 3,863 | 2018-05-02T13:42:39.000Z | 2022-03-31T19:03:32.000Z | tests/test_constraints.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 4,796 | 2018-05-02T07:55:51.000Z | 2022-03-31T14:46:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import unittest
import torch
from fairseq.token_generation_constraints import *
def tensorize(constraints: List[List[int]]) -> t... | 38.844444 | 147 | 0.407799 |
import sys
import unittest
import torch
from fairseq.token_generation_constraints import *
def tensorize(constraints: List[List[int]]) -> torch.Tensor:
return [torch.tensor(x) for x in constraints]
class TestHelperRoutines(unittest.TestCase):
def setUp(self):
self.examples = [
([[]... | true | true |
1c37f7e6c054d21b947432e0ed49dc8f464351aa | 7,653 | py | Python | formatting.py | basnijholt/qcodes-repr | ab761b385c3ec60f16e975667bc08a9e30f0cb2f | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 1 | 2020-03-27T14:16:32.000Z | 2020-03-27T14:16:32.000Z | formatting.py | basnijholt/qcodes-repr | ab761b385c3ec60f16e975667bc08a9e30f0cb2f | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | formatting.py | basnijholt/qcodes-repr | ab761b385c3ec60f16e975667bc08a9e30f0cb2f | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | """String formatting routines for qcodes.DataSet.__repr__.
This code heavily borrows from `xarray`, whose license can be found
in `licenses/XARRAY_LICENSE`.
"""
import contextlib
from datetime import datetime, timedelta
from itertools import zip_longest
import numpy as np
import pandas as pd
from pandas.errors impor... | 34.318386 | 87 | 0.647197 |
import contextlib
from datetime import datetime, timedelta
from itertools import zip_longest
import numpy as np
import pandas as pd
from pandas.errors import OutOfBoundsDatetime
from xarray.core.options import OPTIONS
def _get_indexer_at_least_n_items(shape, n_desired, from_end):
assert 0 < n_desired <= np.pro... | true | true |
1c37f80ab49df26482e3284512cd6e122b448ff3 | 439 | py | Python | nadine/migrations/0002_auto_20150623_1653.py | FarsetLabs/farset-nadine | f0f5e81a9fbe98a4333f6318443fefbb5517c60f | [
"Apache-2.0"
] | null | null | null | nadine/migrations/0002_auto_20150623_1653.py | FarsetLabs/farset-nadine | f0f5e81a9fbe98a4333f6318443fefbb5517c60f | [
"Apache-2.0"
] | 4 | 2021-03-19T16:10:13.000Z | 2022-03-12T00:55:50.000Z | nadine/migrations/0002_auto_20150623_1653.py | FarsetLabs/farset-nadine | f0f5e81a9fbe98a4333f6318443fefbb5517c60f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('nadine', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='m... | 20.904762 | 68 | 0.624146 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('nadine', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='member',
nam... | true | true |
1c37f81033c088ac5b6d8e9188f6a52d509c8de9 | 776 | py | Python | Python3/0568-Maximum-Vacation-Days/soln-2.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0568-Maximum-Vacation-Days/soln-2.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0568-Maximum-Vacation-Days/soln-2.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def maxVacationDays(self, flights: List[List[int]], days: List[List[int]]) -> int:
graph = collections.defaultdict(set)
N = len(flights)
for i in range(N):
for j in range(N):
if flights[i][j]:
graph[j].add(i)
for i in ra... | 35.272727 | 86 | 0.420103 | class Solution:
def maxVacationDays(self, flights: List[List[int]], days: List[List[int]]) -> int:
graph = collections.defaultdict(set)
N = len(flights)
for i in range(N):
for j in range(N):
if flights[i][j]:
graph[j].add(i)
for i in ra... | true | true |
1c37fb13067944f3c1ba1913aed20285b9dd6423 | 669 | py | Python | src/apps/smallbank/tests/small_bank_client.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 530 | 2019-05-07T03:07:15.000Z | 2022-03-29T16:33:06.000Z | src/apps/smallbank/tests/small_bank_client.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 3,393 | 2019-05-07T08:33:32.000Z | 2022-03-31T14:57:14.000Z | src/apps/smallbank/tests/small_bank_client.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 158 | 2019-05-07T09:17:56.000Z | 2022-03-25T16:45:04.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.perfclient
import sys
import os
if __name__ == "__main__":
def add(parser):
parser.add_argument(
"-u", "--accounts", help="Number of accounts", default=10, type=int
)
... | 29.086957 | 80 | 0.684604 |
import infra.perfclient
import sys
import os
if __name__ == "__main__":
def add(parser):
parser.add_argument(
"-u", "--accounts", help="Number of accounts", default=10, type=int
)
args, unknown_args = infra.perfclient.cli_args(add=add, accept_unknown=True)
unknown_args = [t... | true | true |
1c37fb2836ff26f75ba7be240ba71968c1b15ad0 | 555 | py | Python | qtanim/util.py | plotlyst/qt-anim | 1729512448cabf33cbd5c899a1c0de5afc57115b | [
"MIT"
] | null | null | null | qtanim/util.py | plotlyst/qt-anim | 1729512448cabf33cbd5c899a1c0de5afc57115b | [
"MIT"
] | 7 | 2022-02-15T07:25:43.000Z | 2022-02-24T17:45:46.000Z | qtanim/util.py | plotlyst/qt-anim | 1729512448cabf33cbd5c899a1c0de5afc57115b | [
"MIT"
] | null | null | null | from qtpy.QtCore import QPropertyAnimation
def reverse(animation: QPropertyAnimation) -> QPropertyAnimation:
reversed_animation = QPropertyAnimation(animation.targetObject(), animation.propertyName(), animation.parent())
reversed_animation.setDuration(animation.duration())
reversed_animation.setLoopCount(... | 42.692308 | 115 | 0.814414 | from qtpy.QtCore import QPropertyAnimation
def reverse(animation: QPropertyAnimation) -> QPropertyAnimation:
reversed_animation = QPropertyAnimation(animation.targetObject(), animation.propertyName(), animation.parent())
reversed_animation.setDuration(animation.duration())
reversed_animation.setLoopCount(... | true | true |
1c37fb8c8a637edc0ca9c8e3cc568657dc45cffb | 3,423 | py | Python | examples/03-Circuit/Touchstone_Management.py | PipKat/pyaedt | 0c56c35cab30ef2ba63a0333b64c3d34f9f9820d | [
"MIT"
] | null | null | null | examples/03-Circuit/Touchstone_Management.py | PipKat/pyaedt | 0c56c35cab30ef2ba63a0333b64c3d34f9f9820d | [
"MIT"
] | null | null | null | examples/03-Circuit/Touchstone_Management.py | PipKat/pyaedt | 0c56c35cab30ef2ba63a0333b64c3d34f9f9820d | [
"MIT"
] | null | null | null | """
Manage Touchstone Objects
--------------------------
This example shows how to use Touchstone objects without opening AEDT.
To provide the advanced postprocessing features needed for this example, Matplotlib and NumPy
must be installed on the machine.
This example runs only on Windows using CPython.
"""
# sphinx_... | 34.928571 | 116 | 0.659947 |
import os
import pathlib
import sys
local_path = os.path.abspath("")
module_path = pathlib.Path(local_path)
root_path = module_path.parent
root_path2 = root_path.parent
root_path3 = root_path2.parent
path1 = os.path.join(root_path2)
path2 = os.path.join(root_path3)
sys.path.append(path1)
sys.path.append(path2)
from ... | true | true |
1c37fbe3740f799e230448731507ac360a8008e0 | 1,145 | py | Python | Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/059.py | rafaelvizu/Estudos | eef5e3e3706ff99959226c51b9907b6af4377bfe | [
"MIT"
] | null | null | null | Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/059.py | rafaelvizu/Estudos | eef5e3e3706ff99959226c51b9907b6af4377bfe | [
"MIT"
] | null | null | null | Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/059.py | rafaelvizu/Estudos | eef5e3e3706ff99959226c51b9907b6af4377bfe | [
"MIT"
] | null | null | null | print('\033[36;40mExercício Python #059 - Criando um Menu de Opções\033[m')
from time import sleep
n1 = float(input(' DIGITE UM NÚMERO: '))
n2 = float(input(' DIGITE OUTRO NÚMERO: '))
sleep(1)
print('=-=' * 20)
escolha = 0
t = 0
maior = 0
while escolha != 5:
print('=-=' * 20)
print(''' |1| somar
|2... | 25.444444 | 75 | 0.504803 | print('\033[36;40mExercício Python #059 - Criando um Menu de Opções\033[m')
from time import sleep
n1 = float(input(' DIGITE UM NÚMERO: '))
n2 = float(input(' DIGITE OUTRO NÚMERO: '))
sleep(1)
print('=-=' * 20)
escolha = 0
t = 0
maior = 0
while escolha != 5:
print('=-=' * 20)
print(''' |1| somar
|2... | true | true |
1c37fc0590e08961d14854434f713d4788951f42 | 11,430 | py | Python | lale/lib/autogen/random_forest_regressor.py | gbdrt/lale | 291f824a6b96f088e787979ca768f50d7758424e | [
"Apache-2.0"
] | null | null | null | lale/lib/autogen/random_forest_regressor.py | gbdrt/lale | 291f824a6b96f088e787979ca768f50d7758424e | [
"Apache-2.0"
] | null | null | null | lale/lib/autogen/random_forest_regressor.py | gbdrt/lale | 291f824a6b96f088e787979ca768f50d7758424e | [
"Apache-2.0"
] | null | null | null | from numpy import inf, nan
from sklearn.ensemble import RandomForestRegressor as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class RandomForestRegressorImpl:
def __init__(self, **hyperparams):
self._hyperparams = hyperparams
self._wrapped_model = Op(**se... | 40.967742 | 263 | 0.438058 | from numpy import inf, nan
from sklearn.ensemble import RandomForestRegressor as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class RandomForestRegressorImpl:
def __init__(self, **hyperparams):
self._hyperparams = hyperparams
self._wrapped_model = Op(**se... | true | true |
1c37fd2e142da8bf1ac16171e19030e040e98417 | 163 | py | Python | player/views.py | BehindLoader/bandcamp-parser | bb1d2278d8275bd29888ce9a4fd5627400543cd0 | [
"MIT"
] | null | null | null | player/views.py | BehindLoader/bandcamp-parser | bb1d2278d8275bd29888ce9a4fd5627400543cd0 | [
"MIT"
] | null | null | null | player/views.py | BehindLoader/bandcamp-parser | bb1d2278d8275bd29888ce9a4fd5627400543cd0 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render_to_response
def index(request):
return HttpResponse(render_to_response('index.html')) | 32.6 | 57 | 0.828221 | from django.http import HttpResponse
from django.shortcuts import render_to_response
def index(request):
return HttpResponse(render_to_response('index.html')) | true | true |
1c37fde31ae7cbc8d4dffa6ba9e15c4e16302abc | 28,755 | py | Python | web/handlers/user.py | billypon/qiandao | 7e0d883c294ada443b1cdaf7e7e44538b30ab8e0 | [
"MIT"
] | 2 | 2020-07-15T13:33:26.000Z | 2021-11-27T13:33:34.000Z | web/handlers/user.py | billypon/qiandao | 7e0d883c294ada443b1cdaf7e7e44538b30ab8e0 | [
"MIT"
] | 1 | 2021-04-09T17:21:07.000Z | 2021-04-09T17:21:07.000Z | web/handlers/user.py | BlueskyClouds/qiandao | 5154c09963e1d05ce077772868cfcf4614f551c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-08-09 11:39:25
import json
import time
import datetime
from tornado import gen
import re
import os
import config
from .base import *
import sqlite3
... | 45.861244 | 222 | 0.469623 |
import json
import time
import datetime
from tornado import gen
import re
import os
import config
from .base import *
import sqlite3
from backup import DBnew
import codecs
import traceback
from libs.funcs import pusher
def tostr(s):
if isinstance(s, bytes):
try:
return s.decode()
... | true | true |
1c37fe08e652b5a8d8bac27da9b61ca7524d1ea8 | 1,239 | py | Python | environments/mujoco/rand_param_envs/gym/envs/mujoco/swimmer.py | lfeng1999/varibad | 840f4bd56ccee96a6c162265d18ec54db8b77a1e | [
"MIT"
] | 119 | 2020-02-12T07:06:17.000Z | 2022-03-24T08:37:34.000Z | environments/mujoco/rand_param_envs/gym/envs/mujoco/swimmer.py | lfeng1999/varibad | 840f4bd56ccee96a6c162265d18ec54db8b77a1e | [
"MIT"
] | 2 | 2020-05-24T22:33:42.000Z | 2020-09-28T16:42:02.000Z | environments/mujoco/rand_param_envs/gym/envs/mujoco/swimmer.py | lfeng1999/varibad | 840f4bd56ccee96a6c162265d18ec54db8b77a1e | [
"MIT"
] | 26 | 2020-04-20T13:10:11.000Z | 2022-03-22T10:21:10.000Z | import numpy as np
from environments.mujoco.rand_param_envs.gym import utils
from environments.mujoco.rand_param_envs.gym.envs.mujoco import mujoco_env
class SwimmerEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'swimmer.xml', 4)
utils.EzPickle.... | 36.441176 | 90 | 0.66021 | import numpy as np
from environments.mujoco.rand_param_envs.gym import utils
from environments.mujoco.rand_param_envs.gym.envs.mujoco import mujoco_env
class SwimmerEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'swimmer.xml', 4)
utils.EzPickle.... | true | true |
1c37fefbd00e7eae361d044574c913669ad2c0db | 5,098 | py | Python | options/base_options.py | thsshz/DeblurGAN | b0c786e15256639f145737874aa71fc77263b959 | [
"BSD-3-Clause"
] | null | null | null | options/base_options.py | thsshz/DeblurGAN | b0c786e15256639f145737874aa71fc77263b959 | [
"BSD-3-Clause"
] | null | null | null | options/base_options.py | thsshz/DeblurGAN | b0c786e15256639f145737874aa71fc77263b959 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import os
from util import util
import torch
class BaseOptions():
def __init__(self):
self.parser = argparse.ArgumentParser()
self.initialized = False
def initialize(self):
self.parser.add_argument('--dataroot', required=True, help='path to images (should have subfolders trainA, trainB, valA, ... | 63.725 | 222 | 0.711455 | import argparse
import os
from util import util
import torch
class BaseOptions():
def __init__(self):
self.parser = argparse.ArgumentParser()
self.initialized = False
def initialize(self):
self.parser.add_argument('--dataroot', required=True, help='path to images (should have subfolders trainA, trainB, valA, ... | true | true |
1c37ff2ad8567d8ae0bf7a3f195e7c78d5ce73e3 | 8,442 | py | Python | agents/HPG/HPG_Gaussian.py | best99317/Deep-RL-Package | 8a6fe4d80c3ab12d062d6aeecac5a50ac5144aad | [
"MIT"
] | 1 | 2020-11-23T13:01:50.000Z | 2020-11-23T13:01:50.000Z | agents/HPG/HPG_Gaussian.py | best99317/Deep-RL-Package | 8a6fe4d80c3ab12d062d6aeecac5a50ac5144aad | [
"MIT"
] | null | null | null | agents/HPG/HPG_Gaussian.py | best99317/Deep-RL-Package | 8a6fe4d80c3ab12d062d6aeecac5a50ac5144aad | [
"MIT"
] | null | null | null | import torch
import numpy as np
from agents.HPG.HPG import HPG
from agents.VPG.VPG_Gaussian import VPG_Gaussian
class HPG_Gaussian(HPG, VPG_Gaussian):
def __init__(self, parameters):
super(HPG_Gaussian, self).__init__(parameters)
def generate_fake_data(self):
self.subgoals = torch.... | 53.09434 | 144 | 0.581853 | import torch
import numpy as np
from agents.HPG.HPG import HPG
from agents.VPG.VPG_Gaussian import VPG_Gaussian
class HPG_Gaussian(HPG, VPG_Gaussian):
def __init__(self, parameters):
super(HPG_Gaussian, self).__init__(parameters)
def generate_fake_data(self):
self.subgoals = torch.... | true | true |
1c37ff37b67a9c10cb9e908d037585d276d1221d | 1,683 | py | Python | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/UpdateNodeGroupRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/UpdateNodeGroupRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/UpdateNodeGroupRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.4 | 82 | 0.771242 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdklinkwan.endpoint import endpoint_data
class UpdateNodeGroupRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'LinkWAN', '2019-03-01', 'UpdateNodeGroup','linkwan')
self.set_protocol_type('https')
self.set_method('PO... | true | true |
1c380014554ec0ceb12517cd16576401efeaaf7e | 126 | py | Python | autoarray/inversion/pixelizations/__init__.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 5 | 2019-09-26T02:18:25.000Z | 2021-12-11T16:29:20.000Z | autoarray/inversion/pixelizations/__init__.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 3 | 2020-03-30T14:25:57.000Z | 2021-12-21T17:10:55.000Z | autoarray/inversion/pixelizations/__init__.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 4 | 2020-03-03T11:35:41.000Z | 2022-01-21T17:37:35.000Z | from .rectangular import Rectangular
from .voronoi import VoronoiMagnification
from .voronoi import VoronoiBrightnessImage
| 31.5 | 44 | 0.857143 | from .rectangular import Rectangular
from .voronoi import VoronoiMagnification
from .voronoi import VoronoiBrightnessImage
| true | true |
1c38018da44b416e1337f2f34a5b081d20ba6544 | 4,940 | py | Python | Lab4/nnCostFunction.py | A2Zntu/ML_HW | 00db8a45ba38fc864b71c31b0255488c95880c4c | [
"MIT"
] | null | null | null | Lab4/nnCostFunction.py | A2Zntu/ML_HW | 00db8a45ba38fc864b71c31b0255488c95880c4c | [
"MIT"
] | null | null | null | Lab4/nnCostFunction.py | A2Zntu/ML_HW | 00db8a45ba38fc864b71c31b0255488c95880c4c | [
"MIT"
] | null | null | null | import numpy as np
from sigmoid import sigmoid
from sigmoidGradient import sigmoidGradient
def nnCostFunction(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y, lambda_value):
#NNCOSTFUNCTION Implements the neural network cost function for a two layer
#neural network which performs classification
# [J... | 42.586207 | 114 | 0.646559 | import numpy as np
from sigmoid import sigmoid
from sigmoidGradient import sigmoidGradient
def nnCostFunction(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y, lambda_value):
tmp = nn_params.copy()
Theta1 = np.reshape(tmp[0:hidden_layer_size * (input_layer_size + 1)],
... | true | true |
1c38024d6c075a32b114098fa9e7a6ebcbd25700 | 805 | py | Python | rpython/rlib/test/test_rawstorage.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/rlib/test/test_rawstorage.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/rlib/test/test_rawstorage.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z |
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.rawstorage import alloc_raw_storage, free_raw_storage,\
raw_storage_setitem, raw_storage_getitem
from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin
def test_untranslated_storage():
r = alloc_raw_storage(15)
raw_storage... | 33.541667 | 73 | 0.680745 |
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.rawstorage import alloc_raw_storage, free_raw_storage,\
raw_storage_setitem, raw_storage_getitem
from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin
def test_untranslated_storage():
r = alloc_raw_storage(15)
raw_storage... | true | true |
1c38025d963319aef5b2eab108057ff2bcbe01b8 | 864 | py | Python | 6.6_Identifying_Dialogue_Act_Types.py | attibalazs/nltk-examples | 9a5240b8ad7df5869cef26d09c6f534e4238ead1 | [
"MIT"
] | null | null | null | 6.6_Identifying_Dialogue_Act_Types.py | attibalazs/nltk-examples | 9a5240b8ad7df5869cef26d09c6f534e4238ead1 | [
"MIT"
] | null | null | null | 6.6_Identifying_Dialogue_Act_Types.py | attibalazs/nltk-examples | 9a5240b8ad7df5869cef26d09c6f534e4238ead1 | [
"MIT"
] | null | null | null | import nltk
def dialogue_act_features(post):
features = {}
for word in nltk.word_tokenize(post):
features['contains(%s)' % word.lower()] = True
return features
def main():
posts = nltk.corpus.nps_chat.xml_posts()[:10000]
featuresets = [(dialogue_act_features(post.text), post.get('class'... | 32 | 88 | 0.695602 | import nltk
def dialogue_act_features(post):
features = {}
for word in nltk.word_tokenize(post):
features['contains(%s)' % word.lower()] = True
return features
def main():
posts = nltk.corpus.nps_chat.xml_posts()[:10000]
featuresets = [(dialogue_act_features(post.text), post.get('class'... | false | true |
1c380329c78e1bd7aab4ee117625a7ba922d0295 | 675 | py | Python | notebook/dict_merge.py | shuaiwang88/python-snippets | daea8095ce50d08c3b15cb6747a8397abe7852f5 | [
"MIT"
] | null | null | null | notebook/dict_merge.py | shuaiwang88/python-snippets | daea8095ce50d08c3b15cb6747a8397abe7852f5 | [
"MIT"
] | null | null | null | notebook/dict_merge.py | shuaiwang88/python-snippets | daea8095ce50d08c3b15cb6747a8397abe7852f5 | [
"MIT"
] | null | null | null | d1 = {'k1': 1, 'k2': 2}
d2 = {'k1': 100, 'k3': 3, 'k4': 4}
print(d1 | d2)
# {'k1': 100, 'k2': 2, 'k3': 3, 'k4': 4}
print(d2 | d1)
# {'k1': 1, 'k3': 3, 'k4': 4, 'k2': 2}
d1 = {'k1': 1, 'k2': 2}
d2 = {'k3': 3, 'k4': 4}
d3 = {'k5': 5, 'k6': 6}
print(d1 | d2 | d3)
# {'k1': 1, 'k2': 2, 'k3': 3, 'k4': 4, 'k5': 5, 'k6': 6... | 21.09375 | 65 | 0.394074 | d1 = {'k1': 1, 'k2': 2}
d2 = {'k1': 100, 'k3': 3, 'k4': 4}
print(d1 | d2)
print(d2 | d1)
d1 = {'k1': 1, 'k2': 2}
d2 = {'k3': 3, 'k4': 4}
d3 = {'k5': 5, 'k6': 6}
print(d1 | d2 | d3)
d1 = {'k1': 1, 'k2': 2}
d2 = {'k1': 100, 'k3': 3, 'k4': 4}
d1 |= d2
print(d1)
d = {'k1': 1, 'k2': 2}
d |= [('k1', 100), ('k3', ... | true | true |
1c3804b9974ce3beb0690c202a370415a182d3e5 | 2,836 | py | Python | utils/config_loader.py | kevinchoy/oct-schlemm-seg | e8b78695521dc65a7bbd1bcdb65b0a6200af25b3 | [
"BSD-4-Clause-UC"
] | 1 | 2021-11-17T01:54:53.000Z | 2021-11-17T01:54:53.000Z | utils/config_loader.py | kevinchoy/oct-schlemm-seg | e8b78695521dc65a7bbd1bcdb65b0a6200af25b3 | [
"BSD-4-Clause-UC"
] | 1 | 2022-01-24T18:20:04.000Z | 2022-01-24T18:20:04.000Z | utils/config_loader.py | kevinchoy/oct-schlemm-seg | e8b78695521dc65a7bbd1bcdb65b0a6200af25b3 | [
"BSD-4-Clause-UC"
] | null | null | null | """Code for "K. C. Choy, G. Li, W. D. Stamer, S. Farsiu, Open-source deep learning-based automatic segmentation of
mouse Schlemm’s canal in optical coherence tomography images. Experimental Eye Research, 108844 (2021)."
Link: https://www.sciencedirect.com/science/article/pii/S0014483521004103
DOI: 10.1016/j.exer.2021.1... | 35.898734 | 116 | 0.675247 |
import importlib
from typing import Any
from omegaconf import DictConfig
def load_obj(obj_path: str, default_obj_path: str = "") -> Any:
obj_path_list = obj_path.rsplit(".", 1)
obj_path = obj_path_list.pop(0) if len(obj_path_list) > 1 else default_obj_path
obj_name = obj_path_list[0]
module_obj = impo... | true | true |
1c3804f37d05d56c1f4a0f5c4b6da2ca6712099c | 3,618 | py | Python | pybbbc/constants.py | giacomodeodato/Cellular-Images-Dataset | 27d6289d231f869561e0515ecce4934a8e744f39 | [
"MIT"
] | 2 | 2021-07-21T22:49:22.000Z | 2021-08-22T18:17:32.000Z | pybbbc/constants.py | zbarry/pybbbc | 396e78034c3a50fdb585415cbdacd2f8634d6a94 | [
"MIT"
] | 1 | 2021-07-23T23:32:47.000Z | 2021-08-22T13:27:45.000Z | pybbbc/constants.py | zbarry/pybbbc | 396e78034c3a50fdb585415cbdacd2f8634d6a94 | [
"MIT"
] | 1 | 2021-07-21T22:53:08.000Z | 2021-07-21T22:53:08.000Z | """ BBBC021 dataset constants. """
IMG_SHAPE = (3, 1024, 1280)
CHANNELS = ["Actin", "Tubulin", "DAPI"]
N_SITES = 4
PLATES = [
"Week10_40111",
"Week10_40115",
"Week10_40119",
"Week1_22123",
"Week1_22141",
"Week1_22161",
"Week1_22361",
"Week1_22381",
"Week1_22401",
"Week2_24121... | 18.180905 | 39 | 0.556938 |
IMG_SHAPE = (3, 1024, 1280)
CHANNELS = ["Actin", "Tubulin", "DAPI"]
N_SITES = 4
PLATES = [
"Week10_40111",
"Week10_40115",
"Week10_40119",
"Week1_22123",
"Week1_22141",
"Week1_22161",
"Week1_22361",
"Week1_22381",
"Week1_22401",
"Week2_24121",
"Week2_24141",
"Week2_24... | true | true |
1c3805f144c5a71a1bd4b488518ca391dd627c63 | 2,210 | py | Python | runtest_single.py | ayanc/edgeml.mdp | 7f21b88bcf764e927ac8b9997ac9f3b1b2dabcc4 | [
"MIT"
] | 2 | 2020-10-26T21:02:07.000Z | 2021-12-26T19:53:15.000Z | runtest_single.py | ayanc/edgeml.mdp | 7f21b88bcf764e927ac8b9997ac9f3b1b2dabcc4 | [
"MIT"
] | null | null | null | runtest_single.py | ayanc/edgeml.mdp | 7f21b88bcf764e927ac8b9997ac9f3b1b2dabcc4 | [
"MIT"
] | 2 | 2020-10-27T04:43:36.000Z | 2020-12-11T12:47:08.000Z | #!/usr/bin/env python3
# - Ayan Chakrabarti <ayan.chakrabarti@gmail.com>
"""Run experiments to derive and simulate policies for single cameras."""
from multiprocessing import Pool
import numpy as np
from eomdp import simulate as sim
from eomdp import policy as po
FMPATH = 'save/fm_fold%d_cost%d.npz'
OPATH = 'save/1ca... | 34.53125 | 78 | 0.572398 |
from multiprocessing import Pool
import numpy as np
from eomdp import simulate as sim
from eomdp import policy as po
FMPATH = 'save/fm_fold%d_cost%d.npz'
OPATH = 'save/1cam_r%03d_bdepth%02d_cost%d.npz'
PLIST = [(r/20, b/2, c)
for b in range(2, 11)
for r in range(1, 11)
for c in range(3)]
... | true | true |
1c38069901471e89c9b3e32998ffc6795a026a6c | 6,601 | py | Python | alexa/lambda_function.py | jschmidtnj/healthtech19 | 06c0030d0adf3c50d80c88d60dd66d658d52fc94 | [
"MIT"
] | null | null | null | alexa/lambda_function.py | jschmidtnj/healthtech19 | 06c0030d0adf3c50d80c88d60dd66d658d52fc94 | [
"MIT"
] | 4 | 2021-06-08T20:40:24.000Z | 2022-03-12T00:09:32.000Z | alexa/lambda_function.py | jschmidtnj/healthtech19 | 06c0030d0adf3c50d80c88d60dd66d658d52fc94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK for Python.
# Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
# session persistence, api calls, and more.
# This sample is built using the ... | 34.742105 | 110 | 0.695955 |
import logging
import ask_sdk_core.utils as ask_utils
from ask_sdk_core.utils import get_slot_value
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.dispatch_components import AbstractRequestHandler
from ask_sdk_core.dispatch_components import AbstractExceptionHandler
from ask_sdk_core.handl... | true | true |
1c3807a5a7198de51812a4f37f55ff871b501615 | 16,273 | py | Python | trestle/core/repository.py | guyzyl/compliance-trestle | b6fa6f5d8bfdb52e0a82fc0accd63c11d04d9afc | [
"Apache-2.0"
] | 1 | 2022-01-07T01:11:03.000Z | 2022-01-07T01:11:03.000Z | trestle/core/repository.py | guyzyl/compliance-trestle | b6fa6f5d8bfdb52e0a82fc0accd63c11d04d9afc | [
"Apache-2.0"
] | null | null | null | trestle/core/repository.py | guyzyl/compliance-trestle | b6fa6f5d8bfdb52e0a82fc0accd63c11d04d9afc | [
"Apache-2.0"
] | null | null | null | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2021 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... | 44.461749 | 118 | 0.67824 |
import argparse
import logging
import os
import pathlib
import shutil
from typing import List, Type
import trestle.core.commands.assemble as assemblecmd
import trestle.core.commands.merge as mergecmd
import trestle.core.commands.split as splitcmd
import trestle.core.commands.validate as validatecmd
imp... | true | true |
1c38082e57210f4dad01b766fd068864b70ee4b6 | 8,068 | py | Python | gas-adsorption/isothermal-ads-gas-cartoon.py | SimonEnsemble/thesis-pommerenck-1 | c546b981b0fa7cebbe80e32d45dee5e8714ea89c | [
"MIT"
] | 1 | 2021-03-24T00:42:10.000Z | 2021-03-24T00:42:10.000Z | gas-adsorption/isothermal-ads-gas-cartoon.py | SimonEnsemble/thesis-pommerenck-1 | c546b981b0fa7cebbe80e32d45dee5e8714ea89c | [
"MIT"
] | null | null | null | gas-adsorption/isothermal-ads-gas-cartoon.py | SimonEnsemble/thesis-pommerenck-1 | c546b981b0fa7cebbe80e32d45dee5e8714ea89c | [
"MIT"
] | 1 | 2021-03-23T18:42:16.000Z | 2021-03-23T18:42:16.000Z | from __future__ import division, print_function
import sys, os, re, matplotlib
import numpy as np
import matplotlib.pyplot as plt
import numericalunits, colors
matplotlib.rcParams['text.usetex'] = True
from matplotlib.font_manager import FontProperties
small_font = FontProperties()
small_font.set_size('small')
"""
... | 33.065574 | 94 | 0.675756 | from __future__ import division, print_function
import sys, os, re, matplotlib
import numpy as np
import matplotlib.pyplot as plt
import numericalunits, colors
matplotlib.rcParams['text.usetex'] = True
from matplotlib.font_manager import FontProperties
small_font = FontProperties()
small_font.set_size('small')
... | true | true |
1c3808405ceeb080bb162440ec4e5ef6f3314d17 | 355 | py | Python | atest/testdata/core/resources_and_variables/vars_from_cli.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | atest/testdata/core/resources_and_variables/vars_from_cli.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | atest/testdata/core/resources_and_variables/vars_from_cli.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | scalar_from_cli_varfile = 'Scalar from variable file from cli'
scalar_from_cli_varfile_with_escapes = '1 \\ 2\\\\ ${inv}'
list_var_from_cli_varfile = 'Scalar list from variable file from cli'.split()
LIST__list_var_from_cli_varfile = 'List from variable file from cli'.split()
clivar = 'This value is not taken into use ... | 71 | 78 | 0.788732 | scalar_from_cli_varfile = 'Scalar from variable file from cli'
scalar_from_cli_varfile_with_escapes = '1 \\ 2\\\\ ${inv}'
list_var_from_cli_varfile = 'Scalar list from variable file from cli'.split()
LIST__list_var_from_cli_varfile = 'List from variable file from cli'.split()
clivar = 'This value is not taken into use ... | true | true |
1c3808f407eca8b39d1ee43531c7f46c298bde7b | 875 | py | Python | tests/null_queries/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 3 | 2020-05-30T17:08:51.000Z | 2021-12-14T02:55:19.000Z | tests/null_queries/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 1 | 2021-03-24T12:21:05.000Z | 2021-03-24T12:31:52.000Z | tests/null_queries/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 4 | 2016-07-31T14:29:15.000Z | 2021-10-19T03:32:44.000Z | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Poll(models.Model):
question = models.CharField(max_length=200)
def __str__(self):
return "Q: %s " % self.question
@python_2_unicode... | 23.026316 | 65 | 0.730286 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Poll(models.Model):
question = models.CharField(max_length=200)
def __str__(self):
return "Q: %s " % self.question
@python_2_unicode... | true | true |
1c38098e2e0cbd4a4f5f91067a4c67b626320d11 | 121 | py | Python | gallery/admin.py | paint-your-blues/platform | f149ae4269a65dd58bed8bc2aaecc729225c7a35 | [
"MIT"
] | null | null | null | gallery/admin.py | paint-your-blues/platform | f149ae4269a65dd58bed8bc2aaecc729225c7a35 | [
"MIT"
] | 9 | 2020-05-15T07:56:36.000Z | 2022-03-12T00:29:53.000Z | gallery/admin.py | paint-your-blues/platform | f149ae4269a65dd58bed8bc2aaecc729225c7a35 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Gallery
admin.site.register(Gallery) | 17.285714 | 32 | 0.801653 | from django.contrib import admin
from .models import Gallery
admin.site.register(Gallery) | true | true |
1c380a98335558caacf7e721683162e61b24640d | 599 | py | Python | jp.atcoder/abc162/abc162_e/28324642.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc162/abc162_e/28324642.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc162/abc162_e/28324642.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import typing
def main() -> typing.NoReturn:
n, k = map(int, input().split())
# let g := GCD(A)
# for each g, count up the number of A such that GCD(A) = g
# let this function as f(g)
# f(d) = (K // d)^N - \sum_{g=d * 2, step=d}^{K}f(g)
MOD = 10 ** 9 + 7
cnt = [0] * (k + 1)... | 21.392857 | 64 | 0.414023 | import typing
def main() -> typing.NoReturn:
n, k = map(int, input().split())
MOD = 10 ** 9 + 7
cnt = [0] * (k + 1)
for d in range(k, 0, -1):
cnt[d] = pow(k // d, n, MOD)
for g in range(d * 2, k + 1, d):
cnt[d] -= cnt[g]
cnt[d] %... | true | true |
1c380ada6fce66f66954e8d644e235f8bb7554c5 | 13,937 | py | Python | TUI/TCC/NudgerWindow.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/TCC/NudgerWindow.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/TCC/NudgerWindow.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Graphical offsetter.
History:
2005-05-24 ROwen
2005-05-26 ROwen Bug fix: _iimScaleCallback was totally broken, so the nudger box
labels were always to the right and above.
2005-06-03 ROwen Improved uniformity of indentation.
2005-04-20 ROwen All offsets are now com... | 33.909976 | 108 | 0.573581 |
import Tkinter
import RO.CnvUtil
import RO.Constants
import RO.Wdg
import opscore.actor.keyvar
import TUI.Base.Wdg
import TUI.Models
WindowName = "TCC.Nudger"
def addWindow(tlSet):
tlSet.createToplevel(
name = WindowName,
defGeom = "+50+507",
resizable = False,
visible = False,
... | true | true |
1c380b51f22c8559dfcda9b4e058681d75902e3c | 38,189 | py | Python | pytype/tests/test_import.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_import.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_import.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | """Tests for import."""
from pytype import file_utils
from pytype import imports_map_loader
from pytype.pytd import pytd_utils
from pytype.tests import test_base
DEFAULT_PYI = """
from typing import Any
def __getattr__(name) -> Any: ...
"""
class ImportTest(test_base.TargetIndependentTest):
"""Tests for import."... | 29.952157 | 80 | 0.535547 |
from pytype import file_utils
from pytype import imports_map_loader
from pytype.pytd import pytd_utils
from pytype.tests import test_base
DEFAULT_PYI = """
from typing import Any
def __getattr__(name) -> Any: ...
"""
class ImportTest(test_base.TargetIndependentTest):
def test_basic_import(self):
ty = self.I... | true | true |
1c380b68fd247efcc782fc4a623038204c503d2f | 2,305 | py | Python | web_api/vdatum_web_api.py | TashiGeleg/vyperdatum | cb7ccd3804c6acf88c9c884c6f4da874c6312498 | [
"CC0-1.0"
] | 2 | 2021-12-01T15:57:34.000Z | 2021-12-03T14:37:48.000Z | web_api/vdatum_web_api.py | TashiGeleg/vyperdatum | cb7ccd3804c6acf88c9c884c6f4da874c6312498 | [
"CC0-1.0"
] | 6 | 2020-12-04T18:07:12.000Z | 2020-12-22T16:59:07.000Z | web_api/vdatum_web_api.py | TashiGeleg/vyperdatum | cb7ccd3804c6acf88c9c884c6f4da874c6312498 | [
"CC0-1.0"
] | 3 | 2020-12-04T18:04:25.000Z | 2021-06-24T15:29:11.000Z | try: # python27
import urllib2
except ImportError: # python38
from urllib.request import Request, urlopen
import json
import time
def vdatum_web_api(src_lat, src_lon, src_height, region='CONTIGUOUS', s_h_frame='NAD83_2011', s_v_frame='MLLW',
t_h_frame='NAD83_2011', t_v_frame='NAVD88'):
... | 29.935065 | 143 | 0.63731 | try:
import urllib2
except ImportError:
from urllib.request import Request, urlopen
import json
import time
def vdatum_web_api(src_lat, src_lon, src_height, region='CONTIGUOUS', s_h_frame='NAD83_2011', s_v_frame='MLLW',
t_h_frame='NAD83_2011', t_v_frame='NAVD88'):
url = 'https://vd... | true | true |
1c380bbbbb91b34e5c8a22816a2b46a968c4393b | 7,867 | py | Python | malaya_speech/train/prepare_data.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/prepare_data.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/prepare_data.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | 1 | 2021-08-19T02:34:41.000Z | 2021-08-19T02:34:41.000Z | # coding=utf-8
# Copyright 2020 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 33.909483 | 82 | 0.652727 |
import tensorflow as tf
import numpy as np
import six
import os
import random
UNSHUFFLED_SUFFIX = '-unshuffled'
def read_records(filename):
reader = tf.python_io.tf_record_iterator(filename)
records = []
for record in reader:
records.append(record)
if len(records) % 100000 ... | true | true |
1c380c77e71d65b628ba4fa9d365cec89f06364c | 1,234 | py | Python | projects/models/experiment.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/models/experiment.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/models/experiment.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Experiment model."""
from datetime import datetime
from sqlalchemy import Boolean, Column, DateTime, Integer, String, Text, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.sql import expression
from .operators import Operator
from ..database import Base
from ..utils impor... | 37.393939 | 90 | 0.709887 |
from datetime import datetime
from sqlalchemy import Boolean, Column, DateTime, Integer, String, Text, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.sql import expression
from .operators import Operator
from ..database import Base
from ..utils import to_camel_case
class Experiment(Base):
_... | true | true |
1c380c9786adad8e2aaef3294fc457c7c0aad6a0 | 9,930 | py | Python | test/diff/diff_files/generate_tests.py | coidx/SPIRV-Tools | d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac | [
"Apache-2.0"
] | null | null | null | test/diff/diff_files/generate_tests.py | coidx/SPIRV-Tools | d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac | [
"Apache-2.0"
] | null | null | null | test/diff/diff_files/generate_tests.py | coidx/SPIRV-Tools | d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python3
#
# Copyright (c) 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.557377 | 114 | 0.697583 |
import glob
import os
import subprocess
import sys
IGNORE_SET_BINDING_TESTS = ['different_decorations_vertex']
IGNORE_LOCATION_TESTS = ['different_decorations_fragment']
IGNORE_DECORATIONS_TESTS = ['different_decorations_vertex', 'different_decorations_fragment']
DUMP_IDS_TESTS = ['basic', 'int_vs_ui... | true | true |
1c380d42d9a0f0b5434bcdaa29d49788e4646cb0 | 2,613 | py | Python | tests/test_issues.py | scikit-hep/uproot-methods | ba9a97b3dc71c7030a9ec15a9d97397b5ff8aa0d | [
"BSD-3-Clause"
] | 15 | 2018-09-25T13:14:05.000Z | 2020-09-04T08:37:45.000Z | tests/test_issues.py | scikit-hep/uproot-methods | ba9a97b3dc71c7030a9ec15a9d97397b5ff8aa0d | [
"BSD-3-Clause"
] | 72 | 2018-09-20T12:57:47.000Z | 2020-11-04T14:16:57.000Z | tests/test_issues.py | scikit-hep/uproot-methods | ba9a97b3dc71c7030a9ec15a9d97397b5ff8aa0d | [
"BSD-3-Clause"
] | 33 | 2018-09-19T22:04:44.000Z | 2020-11-29T09:37:09.000Z | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot3-methods/blob/master/LICENSE
import unittest
import numpy
import awkward0
import uproot3_methods
from uproot3_methods import *
import inspect
class Test(unittest.TestCase):
def runTest(self):
pass
def test_issu... | 39.590909 | 207 | 0.628779 |
import unittest
import numpy
import awkward0
import uproot3_methods
from uproot3_methods import *
import inspect
class Test(unittest.TestCase):
def runTest(self):
pass
def test_issue10(self):
p4 = TLorentzVectorArray.from_ptetaphim(awkward0.JaggedArray.fromiter([[1.0]]), awkward0.Jagged... | true | true |
1c380d77b5630ae7d22e8dd820f194f44e4e2a68 | 39,222 | py | Python | PlaidCTF/2021/a-fallen-lap-ray/parallel-disassembler.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | 1 | 2021-08-24T22:16:41.000Z | 2021-08-24T22:16:41.000Z | PlaidCTF/2021/a-fallen-lap-ray/parallel-disassembler.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | PlaidCTF/2021/a-fallen-lap-ray/parallel-disassembler.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import argparse
import collections
import dataclasses
import enum
import logging
import struct
import sys
import typing
import graphviz
l = logging.getLogger("assembler")
Opcode = collections.namedtuple('Opcode', ['opcode', 'num_inputs', 'repr'])
Instruction = collections.namedtuple('Instructio... | 37.749759 | 135 | 0.555454 |
import argparse
import collections
import dataclasses
import enum
import logging
import struct
import sys
import typing
import graphviz
l = logging.getLogger("assembler")
Opcode = collections.namedtuple('Opcode', ['opcode', 'num_inputs', 'repr'])
Instruction = collections.namedtuple('Instruction', [
... | true | true |
1c380d94c166b32946452e8f3abbd7bcc39bcb42 | 4,500 | py | Python | drf_haystack/mixins.py | fluxility/drf-haystack | 6ff951b9d3fcba0704f891c964bf09374438d530 | [
"MIT"
] | 201 | 2015-02-14T08:17:35.000Z | 2019-07-10T04:19:04.000Z | drf_haystack/mixins.py | fluxility/drf-haystack | 6ff951b9d3fcba0704f891c964bf09374438d530 | [
"MIT"
] | 138 | 2015-02-17T09:28:33.000Z | 2019-07-30T10:29:52.000Z | drf_haystack/mixins.py | fluxility/drf-haystack | 6ff951b9d3fcba0704f891c964bf09374438d530 | [
"MIT"
] | 60 | 2015-04-01T14:51:18.000Z | 2019-05-12T15:31:52.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework.decorators import action
from rest_framework.response import Response
from drf_haystack.filters import HaystackFacetFilter
class MoreLikeThisMixin(object):
"""
Mixin class for supporting "more like this" on... | 36.585366 | 101 | 0.656444 |
from __future__ import absolute_import, unicode_literals
from rest_framework.decorators import action
from rest_framework.response import Response
from drf_haystack.filters import HaystackFacetFilter
class MoreLikeThisMixin(object):
@action(detail=True, methods=["get"], url_path="more-like-this")
def mor... | true | true |
1c380f98ec8ef87ddc3121c906bebafe56b400c8 | 688 | py | Python | cia-dist-cloudformation/src/main/config/aws-org-account/stackset/security/guardduty_response.py | renovate-tests/cia | 4b340ef8afa17cffb5ffe6a5607428a5ce8c70d1 | [
"Apache-2.0"
] | 1 | 2020-06-21T13:50:03.000Z | 2020-06-21T13:50:03.000Z | cia-dist-cloudformation/src/main/config/aws-org-account/stackset/security/guardduty_response.py | renovate-tests/cia | 4b340ef8afa17cffb5ffe6a5607428a5ce8c70d1 | [
"Apache-2.0"
] | null | null | null | cia-dist-cloudformation/src/main/config/aws-org-account/stackset/security/guardduty_response.py | renovate-tests/cia | 4b340ef8afa17cffb5ffe6a5607428a5ce8c70d1 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from botocore.exceptions import ClientError
import json
import datetime
import boto3
import os
def handler(event, context):
print("log -- Event: %s " % json.dumps(event))
response = "Error auto-remediating the finding."
try:
# Set Clients
ec2 = boto3.clien... | 21.5 | 50 | 0.665698 | from __future__ import print_function
from botocore.exceptions import ClientError
import json
import datetime
import boto3
import os
def handler(event, context):
print("log -- Event: %s " % json.dumps(event))
response = "Error auto-remediating the finding."
try:
ec2 = boto3.client('ec2')
... | true | true |
1c381017729f0fcd312c110d56bf11f6a7429f9b | 448 | py | Python | app_backend/migrations/0012_enterpise_tsic_no.py | konjing/django_sme_award | 840ed3685299c77be8516acf1e8a0123930dd63d | [
"MIT"
] | null | null | null | app_backend/migrations/0012_enterpise_tsic_no.py | konjing/django_sme_award | 840ed3685299c77be8516acf1e8a0123930dd63d | [
"MIT"
] | 5 | 2021-03-19T02:32:48.000Z | 2021-06-10T19:01:30.000Z | app_backend/migrations/0012_enterpise_tsic_no.py | konjing/django_sme_award | 840ed3685299c77be8516acf1e8a0123930dd63d | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-28 01:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_backend', '0011_remove_enterpise_regis_cap'),
]
operations = [
migrations.AddField(
model_name='enterpise',
name... | 23.578947 | 98 | 0.627232 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_backend', '0011_remove_enterpise_regis_cap'),
]
operations = [
migrations.AddField(
model_name='enterpise',
name='tsic_no',
field=models.CharField(... | true | true |
1c3810636948f78f89ffd64dd6a5e2b02a26c543 | 1,003 | py | Python | app/resources/v1/ti/indicadores_mun.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2019-07-25T21:15:05.000Z | 2019-07-25T21:15:05.000Z | app/resources/v1/ti/indicadores_mun.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 44 | 2019-08-05T15:24:00.000Z | 2022-01-31T23:11:31.000Z | app/resources/v1/ti/indicadores_mun.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2021-05-11T07:49:51.000Z | 2021-05-11T07:49:51.000Z | ''' Controller para fornecer dados da CEE '''
from flask import request
from flask_restful_swagger_2 import swagger
from resources.base import BaseResource
class IndicadoresTIMunicipiosResource(BaseResource):
''' Classe de múltiplas incidências '''
CUSTOM_SWAGGER_PARAMS = [
{"name": "categorias", "requ... | 38.576923 | 99 | 0.668993 | from flask import request
from flask_restful_swagger_2 import swagger
from resources.base import BaseResource
class IndicadoresTIMunicipiosResource(BaseResource):
CUSTOM_SWAGGER_PARAMS = [
{"name": "categorias", "required": True, "type": 'string', "in": "query",
"description": BaseResource.CAT_IND... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.