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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1709bf4e68de9eb8fef8866f76129ad2619828 | 336 | py | Python | api/serializers/__init__.py | josayko/SoftDeskAPI | a168abb09b09c5cb5f8f4957d028ebde02f3d128 | [
"MIT"
] | null | null | null | api/serializers/__init__.py | josayko/SoftDeskAPI | a168abb09b09c5cb5f8f4957d028ebde02f3d128 | [
"MIT"
] | null | null | null | api/serializers/__init__.py | josayko/SoftDeskAPI | a168abb09b09c5cb5f8f4957d028ebde02f3d128 | [
"MIT"
] | null | null | null | from .comment_serializer import CommentSerializer
from .contributor_serializer import ContributorDetailSerializer, ContributorListSerializer
from .issue_serializer import IssueSerializer
from .project_serializer import ProjectDetailSerializer, ProjectListSerializer
from .user_serializer import UserCreateSerializer, Use... | 56 | 90 | 0.907738 | from .comment_serializer import CommentSerializer
from .contributor_serializer import ContributorDetailSerializer, ContributorListSerializer
from .issue_serializer import IssueSerializer
from .project_serializer import ProjectDetailSerializer, ProjectListSerializer
from .user_serializer import UserCreateSerializer, Use... | true | true |
1c1709dd8adb6caebc7e45fc66b3e744f88ba1c0 | 3,351 | py | Python | scripts/print_track_docstring.py | marypilataki/mirdata | 78981e1f1e7b8661e2d04de0dd5640981bbb1881 | [
"BSD-3-Clause"
] | null | null | null | scripts/print_track_docstring.py | marypilataki/mirdata | 78981e1f1e7b8661e2d04de0dd5640981bbb1881 | [
"BSD-3-Clause"
] | null | null | null | scripts/print_track_docstring.py | marypilataki/mirdata | 78981e1f1e7b8661e2d04de0dd5640981bbb1881 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import importlib
import itertools
import types
import mirdata
TEST_TRACKIDS = {
'beatles': '0111',
'dali': '4b196e6c99574dd49ad00d56e132712b',
'gtzan_genre': 'country.00000',
'guitarset': '03_BN3-119-G_solo',
'ikala': '10161_chorus',
'maestro': '2018/M... | 31.613208 | 96 | 0.629663 |
import argparse
import importlib
import itertools
import types
import mirdata
TEST_TRACKIDS = {
'beatles': '0111',
'dali': '4b196e6c99574dd49ad00d56e132712b',
'gtzan_genre': 'country.00000',
'guitarset': '03_BN3-119-G_solo',
'ikala': '10161_chorus',
'maestro': '2018/MIDI-Unprocessed_Chamber3... | true | true |
1c170a4e22fae49b535ca3b05c0f610a58f68b33 | 4,343 | py | Python | cpo/lib/dependency_manager/plugins/ibm_cloud_terraform_provider_plugin.py | IBM/cloud-pak-operations-cli | 45ddcefb4302801c9a833d1359ea4d740c384556 | [
"Apache-2.0"
] | 7 | 2021-12-07T09:16:24.000Z | 2022-03-08T12:38:54.000Z | cpo/lib/dependency_manager/plugins/ibm_cloud_terraform_provider_plugin.py | IBM/cloud-pak-operations-cli | 45ddcefb4302801c9a833d1359ea4d740c384556 | [
"Apache-2.0"
] | 3 | 2021-11-26T09:43:03.000Z | 2021-12-14T08:04:53.000Z | cpo/lib/dependency_manager/plugins/ibm_cloud_terraform_provider_plugin.py | IBM/cloud-pak-operations-cli | 45ddcefb4302801c9a833d1359ea4d740c384556 | [
"Apache-2.0"
] | 1 | 2022-03-10T07:14:49.000Z | 2022-03-10T07:14:49.000Z | # Copyright 2021, 2022 IBM Corporation
#
# 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 ... | 39.126126 | 114 | 0.713792 |
import os
import pathlib
import urllib.parse
import semver
import cpo.config
import cpo.utils.compression
import cpo.utils.download
import cpo.utils.operating_system
from cpo.lib.dependency_manager.dependency_manager_plugin import AbstractDependencyManagerPlugIn
from cpo.lib.error import DataGateCLIException
from c... | true | true |
1c170acbce27379920fdc5feabc92ee196070ef5 | 4,016 | py | Python | scripts/scil_apply_warp_to_tractogram.py | fullbat/scilpy | 8f5b95a0b298ac95268c94d04a162b14fe2773ad | [
"MIT"
] | null | null | null | scripts/scil_apply_warp_to_tractogram.py | fullbat/scilpy | 8f5b95a0b298ac95268c94d04a162b14fe2773ad | [
"MIT"
] | null | null | null | scripts/scil_apply_warp_to_tractogram.py | fullbat/scilpy | 8f5b95a0b298ac95268c94d04a162b14fe2773ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Warp *.trk using a non linear deformation.
Can be used with Ants or Dipy deformation map.
For more information on how to use the various registration scripts
see the doc/tractogram_registration.md readme file
"""
import argparse
import nibabel as nib... | 36.509091 | 79 | 0.658865 |
import argparse
import nibabel as nib
import numpy as np
from scilpy.io.utils import (add_overwrite_arg, create_header_from_anat,
assert_inputs_exist, assert_outputs_exist)
from scilpy.utils.filenames import split_name_with_nii
from scilpy.utils.streamlines import warp_tractogram
def ... | true | true |
1c170ae5e0920803a9075cd1f1c0e82e7b4535f9 | 3,770 | py | Python | experiments/ashvin/vae/old/td3_full_dim.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/old/td3_full_dim.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/old/td3_full_dim.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.envs.multitask.multitask_env import MultitaskToFlatEnv
from rlkit.envs.multitask.point2d import MultitaskFullVAEPoint2DEnv
from rlkit.envs.mujoco.pusher2d import Pusher2DEnv
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.exploration_strategies.base import (
PolicyWrappedWithExplorationStrate... | 31.157025 | 100 | 0.654642 | from rlkit.envs.multitask.multitask_env import MultitaskToFlatEnv
from rlkit.envs.multitask.point2d import MultitaskFullVAEPoint2DEnv
from rlkit.envs.mujoco.pusher2d import Pusher2DEnv
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.exploration_strategies.base import (
PolicyWrappedWithExplorationStrate... | true | true |
1c170b2b1520464e92ee6aac9c5b48ab39c19ac7 | 3,263 | py | Python | wagtaillinkchecker/views.py | ProjectTIER/wagtail-linkchecker | 60ed22029b61b1372d1568ab9e03c90cab8496a6 | [
"BSD-3-Clause"
] | null | null | null | wagtaillinkchecker/views.py | ProjectTIER/wagtail-linkchecker | 60ed22029b61b1372d1568ab9e03c90cab8496a6 | [
"BSD-3-Clause"
] | null | null | null | wagtaillinkchecker/views.py | ProjectTIER/wagtail-linkchecker | 60ed22029b61b1372d1568ab9e03c90cab8496a6 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from django.shortcuts import redirect, render
from django.utils.lru_cache import lru_cache
from wagtail.wagtailadmin import messages
from wagtail.wagtailadmin.edit_handlers import (ObjectList,
extract_panel_definitions_from_model_cla... | 32.959596 | 98 | 0.703034 | from __future__ import print_function
from django.shortcuts import redirect, render
from django.utils.lru_cache import lru_cache
from wagtail.wagtailadmin import messages
from wagtail.wagtailadmin.edit_handlers import (ObjectList,
extract_panel_definitions_from_model_cla... | true | true |
1c170c68726e4bb0a1bfd302c69045577831b83a | 9,432 | py | Python | train_tcn.py | zzz1515151/self-supervised_learning_sketch | 4253986afc92a1f30ee5caadbc074acb297f43b0 | [
"MIT"
] | 35 | 2020-02-03T13:05:07.000Z | 2022-03-13T16:50:59.000Z | train_tcn.py | zzz1515151/self-supervised_learning_sketch | 4253986afc92a1f30ee5caadbc074acb297f43b0 | [
"MIT"
] | 4 | 2020-02-13T13:28:46.000Z | 2021-10-31T13:53:37.000Z | train_tcn.py | zzz1515151/self-supervised_learning_sketch | 4253986afc92a1f30ee5caadbc074acb297f43b0 | [
"MIT"
] | 10 | 2020-02-15T14:56:03.000Z | 2021-07-03T02:28:40.000Z | from __future__ import print_function
import sys
sys.path.append("../")
import argparse
import os
import torch
import time
import imp
import numpy as np
import datetime
from tensorboardX import SummaryWriter
from tqdm import tqdm
from torch import nn, optim
from torch.nn.utils import clip_grad_norm_
from utils.Average... | 35.592453 | 103 | 0.664122 | from __future__ import print_function
import sys
sys.path.append("../")
import argparse
import os
import torch
import time
import imp
import numpy as np
import datetime
from tensorboardX import SummaryWriter
from tqdm import tqdm
from torch import nn, optim
from torch.nn.utils import clip_grad_norm_
from utils.Average... | true | true |
1c170d5ddfb6ee2499b1555eca5cd01e83bf307d | 2,196 | py | Python | tests/test_request.py | platbr/scrapy-prerender | 85c93665b809d5bb98975b85fa138074a9b90991 | [
"BSD-3-Clause"
] | null | null | null | tests/test_request.py | platbr/scrapy-prerender | 85c93665b809d5bb98975b85fa138074a9b90991 | [
"BSD-3-Clause"
] | null | null | null | tests/test_request.py | platbr/scrapy-prerender | 85c93665b809d5bb98975b85fa138074a9b90991 | [
"BSD-3-Clause"
] | null | null | null | import cgi
from scrapy.http import HtmlResponse
from scrapy_prerender import PrerenderRequest, PrerenderFormRequest
def test_meta_None():
req1 = PrerenderRequest('http://example.com')
req2 = PrerenderRequest('http://example.com', meta=None)
assert req1.meta == req2.meta
def test_prerender_form_request(... | 36.6 | 78 | 0.630692 | import cgi
from scrapy.http import HtmlResponse
from scrapy_prerender import PrerenderRequest, PrerenderFormRequest
def test_meta_None():
req1 = PrerenderRequest('http://example.com')
req2 = PrerenderRequest('http://example.com', meta=None)
assert req1.meta == req2.meta
def test_prerender_form_request(... | true | true |
1c170ea9dd399a2a93b78d3b832b35d7053d9a2c | 219 | py | Python | erpnext/hr/doctype/offer_term/test_offer_term.py | nagendrarawat/erpnext_custom | 1b94ecc3e66eae402347c302cd1663b690fb1ade | [
"MIT"
] | 2 | 2019-10-01T13:07:39.000Z | 2019-10-03T03:52:19.000Z | erpnext/hr/doctype/offer_term/test_offer_term.py | nagendrarawat/erpnext_custom | 1b94ecc3e66eae402347c302cd1663b690fb1ade | [
"MIT"
] | null | null | null | erpnext/hr/doctype/offer_term/test_offer_term.py | nagendrarawat/erpnext_custom | 1b94ecc3e66eae402347c302cd1663b690fb1ade | [
"MIT"
] | 3 | 2019-09-30T19:17:44.000Z | 2019-10-23T18:59:12.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestOfferTerm(unittest.TestCase):
pass
| 19.909091 | 58 | 0.776256 | from __future__ import unicode_literals
import frappe
import unittest
class TestOfferTerm(unittest.TestCase):
pass
| true | true |
1c170f1e40bc1be0a7c6a82d2846c4dcc12d2c6c | 5,507 | py | Python | bd_demo/bd_demo/user/purchase.py | vinhnguyent090/bd_demo | 9a6e0277fcddc0202358e0bbffe2b149ba8894e4 | [
"MIT"
] | null | null | null | bd_demo/bd_demo/user/purchase.py | vinhnguyent090/bd_demo | 9a6e0277fcddc0202358e0bbffe2b149ba8894e4 | [
"MIT"
] | null | null | null | bd_demo/bd_demo/user/purchase.py | vinhnguyent090/bd_demo | 9a6e0277fcddc0202358e0bbffe2b149ba8894e4 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, random
from frappe.utils.make_random import how_many, get_random
from frappe.desk import query_report
from erpnext.setup.utils import ge... | 35.076433 | 94 | 0.742691 |
from __future__ import unicode_literals
import frappe, random
from frappe.utils.make_random import how_many, get_random
from frappe.desk import query_report
from erpnext.setup.utils import get_exchange_rate
from erpnext.accounts.party import get_party_account_currency
from erpnext.exceptions import InvalidCurrency
fr... | true | true |
1c170f726e762c0e056f7e4b7a7cae2d537d723e | 4,170 | py | Python | tests/test_kosh_schema.py | tanimislam/kosh | aba17fd5393090e9fbfb3c6b3e7ab0f4a301ab26 | [
"MIT"
] | null | null | null | tests/test_kosh_schema.py | tanimislam/kosh | aba17fd5393090e9fbfb3c6b3e7ab0f4a301ab26 | [
"MIT"
] | null | null | null | tests/test_kosh_schema.py | tanimislam/kosh | aba17fd5393090e9fbfb3c6b3e7ab0f4a301ab26 | [
"MIT"
] | null | null | null | import os
from koshbase import KoshTest
import kosh
from kosh.schema import KoshSchema
def g5(value):
assert(value > 5)
return True
def g5b(value):
if value > 5:
return True
else:
return False
class KoshTestDataset(KoshTest):
def test_store_schema(self):
store, kosh_db ... | 33.095238 | 79 | 0.559472 | import os
from koshbase import KoshTest
import kosh
from kosh.schema import KoshSchema
def g5(value):
assert(value > 5)
return True
def g5b(value):
if value > 5:
return True
else:
return False
class KoshTestDataset(KoshTest):
def test_store_schema(self):
store, kosh_db ... | true | true |
1c170f971b898f9f93bde27228d116049b974670 | 409 | py | Python | lab/lab08/tests/case1.py | tingjunwong/cs88-python-data-structure | 6d0da2c1468b9a571c742a62ab0b8cf625688591 | [
"MIT"
] | null | null | null | lab/lab08/tests/case1.py | tingjunwong/cs88-python-data-structure | 6d0da2c1468b9a571c742a62ab0b8cf625688591 | [
"MIT"
] | null | null | null | lab/lab08/tests/case1.py | tingjunwong/cs88-python-data-structure | 6d0da2c1468b9a571c742a62ab0b8cf625688591 | [
"MIT"
] | null | null | null | test = {
'name': 'Case 1',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
>>> x = [1, 2, 3, 4]
>>> y = x
>>> y[0] = 5
>>> y
[5, 2, 3, 4]
>>> x
[5, 2, 3, 4]
""",
'hidden': False,
'l... | 15.730769 | 30 | 0.237164 | test = {
'name': 'Case 1',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
>>> x = [1, 2, 3, 4]
>>> y = x
>>> y[0] = 5
>>> y
[5, 2, 3, 4]
>>> x
[5, 2, 3, 4]
""",
'hidden': False,
'l... | true | true |
1c17100aaa8894c5d90d55525dc9c992009014c7 | 6,630 | py | Python | tests/test_set_and.py | blackelk/uiset | b46d8d0d47edb0669af1cc624fab764d47b89e0a | [
"MIT"
] | 1 | 2021-04-18T14:14:00.000Z | 2021-04-18T14:14:00.000Z | tests/test_set_and.py | blackelk/uiset | b46d8d0d47edb0669af1cc624fab764d47b89e0a | [
"MIT"
] | 1 | 2021-06-01T22:11:39.000Z | 2021-06-01T22:11:39.000Z | tests/test_set_and.py | blackelk/set-algebra | b46d8d0d47edb0669af1cc624fab764d47b89e0a | [
"MIT"
] | null | null | null | from set_algebra import Set
def do_bulk_and_tests(tests):
for x, y, expected in tests:
X = Set(x)
Y = Set(y)
Z1 = X & Y
assert Z1 == Set(expected), '%s & %s -> %s' % \
(X.notation, Y.notation, Z1.notation)
Z2 = Y & X
assert Z1 == Z2
assert X =... | 28.951965 | 88 | 0.19095 | from set_algebra import Set
def do_bulk_and_tests(tests):
for x, y, expected in tests:
X = Set(x)
Y = Set(y)
Z1 = X & Y
assert Z1 == Set(expected), '%s & %s -> %s' % \
(X.notation, Y.notation, Z1.notation)
Z2 = Y & X
assert Z1 == Z2
assert X =... | true | true |
1c171125d5ce6bafc90cd40099cfb5f0379fa431 | 1,046 | py | Python | FreeTAKServer/model/SQLAlchemy/federations.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | FreeTAKServer/model/SQLAlchemy/federations.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | FreeTAKServer/model/SQLAlchemy/federations.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | from FreeTAKServer.model.SQLAlchemy.Root import Base, Root
from sqlalchemy import Column, String, Integer, UniqueConstraint, Boolean
class Federations(Base):
__tablename__ = "Federations"
id = Column(String, primary_key=True)
name = Column(String, unique=True)
address = Column(String)
port = Column... | 38.740741 | 73 | 0.720841 | from FreeTAKServer.model.SQLAlchemy.Root import Base, Root
from sqlalchemy import Column, String, Integer, UniqueConstraint, Boolean
class Federations(Base):
__tablename__ = "Federations"
id = Column(String, primary_key=True)
name = Column(String, unique=True)
address = Column(String)
port = Column... | true | true |
1c17116281581e915fb269710c4ec9db3889a680 | 3,857 | py | Python | app/run.py | sujanshahi050/Disaster-Response-Classifier | fb8a9a28eeba7f9e8f1d63bff85ee45ca43892ab | [
"MIT"
] | null | null | null | app/run.py | sujanshahi050/Disaster-Response-Classifier | fb8a9a28eeba7f9e8f1d63bff85ee45ca43892ab | [
"MIT"
] | null | null | null | app/run.py | sujanshahi050/Disaster-Response-Classifier | fb8a9a28eeba7f9e8f1d63bff85ee45ca43892ab | [
"MIT"
] | null | null | null | import json
import plotly
import pandas as pd
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
from sklearn.externals import joblib
from sqlalchemy import create_engine
app = F... | 27.748201 | 109 | 0.589059 | import json
import plotly
import pandas as pd
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
from sklearn.externals import joblib
from sqlalchemy import create_engine
app = F... | true | true |
1c1711c8579fc0608d59f12ec19b7009a6ca22d3 | 7,994 | py | Python | bcbio/rnaseq/bcbiornaseq.py | naumenko-sa/bcbio-nextgen | ddf79c2d53f9455d8edfa0e449369d0bf8a4b9b8 | [
"MIT"
] | 418 | 2015-01-01T18:21:17.000Z | 2018-03-02T07:26:28.000Z | bcbio/rnaseq/bcbiornaseq.py | naumenko-sa/bcbio-nextgen | ddf79c2d53f9455d8edfa0e449369d0bf8a4b9b8 | [
"MIT"
] | 1,634 | 2015-01-04T11:43:43.000Z | 2018-03-05T18:06:39.000Z | bcbio/rnaseq/bcbiornaseq.py | naumenko-sa/bcbio-nextgen | ddf79c2d53f9455d8edfa0e449369d0bf8a4b9b8 | [
"MIT"
] | 218 | 2015-01-26T05:58:18.000Z | 2018-03-03T05:50:05.000Z | import os
import shutil
import toolz as tz
from string import Template
from bcbio.utils import file_exists, Rscript_cmd, safe_makedir, chdir
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio.pipeline import datadict as dd
from datetime import datetime as dt
from pathl... | 41.635417 | 117 | 0.663498 | import os
import shutil
import toolz as tz
from string import Template
from bcbio.utils import file_exists, Rscript_cmd, safe_makedir, chdir
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio.pipeline import datadict as dd
from datetime import datetime as dt
from pathl... | true | true |
1c17121e1fdc4a5add1555ebb6817115d22e80bd | 1,926 | py | Python | tests/thirdparty/github/test_pygithub_object_wrapper.py | gshefer/Nudgebot | 4cf6cf1fe975a9002299f0460873c0f21bc8d414 | [
"MIT"
] | 3 | 2018-04-03T14:34:39.000Z | 2018-04-26T12:18:49.000Z | tests/thirdparty/github/test_pygithub_object_wrapper.py | gshefer/Nudgebot | 4cf6cf1fe975a9002299f0460873c0f21bc8d414 | [
"MIT"
] | null | null | null | tests/thirdparty/github/test_pygithub_object_wrapper.py | gshefer/Nudgebot | 4cf6cf1fe975a9002299f0460873c0f21bc8d414 | [
"MIT"
] | null | null | null | import pytest
from tests.fixtures import * # noqa
from nudgebot.exceptions import NoWrapperForPyGithubObjectException
@pytest.fixture(scope='module')
def some_repo():
from nudgebot.thirdparty.github.repository import Repository
return Repository.instantiate('octocat', 'Hello-World')
@pytest.fixture(scope=... | 40.978723 | 93 | 0.770509 | import pytest
from tests.fixtures import * from nudgebot.exceptions import NoWrapperForPyGithubObjectException
@pytest.fixture(scope='module')
def some_repo():
from nudgebot.thirdparty.github.repository import Repository
return Repository.instantiate('octocat', 'Hello-World')
@pytest.fixture(scope='module... | true | true |
1c171328730537abbc3ebff894e8ff5564987e0a | 1,491 | py | Python | backend/job_board/models.py | patrick91/pycon | 9d7e15f540adcf0eaceb61fdbf67206d6aef73ec | [
"MIT"
] | 2 | 2017-07-18T21:51:25.000Z | 2017-12-23T11:08:39.000Z | backend/job_board/models.py | patrick91/pycon | 9d7e15f540adcf0eaceb61fdbf67206d6aef73ec | [
"MIT"
] | 23 | 2017-07-18T20:22:38.000Z | 2018-01-05T05:45:15.000Z | backend/job_board/models.py | patrick91/pycon | 9d7e15f540adcf0eaceb61fdbf67206d6aef73ec | [
"MIT"
] | 2 | 2017-07-18T21:27:33.000Z | 2017-07-18T22:07:03.000Z | import json
from copy import copy
from django.conf import settings
from django.db import models
from django.db.models import Q
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
from model_utils.models import TimeStampedModel
from ordered_model.models import OrderedModel, Orde... | 29.235294 | 74 | 0.686117 | import json
from copy import copy
from django.conf import settings
from django.db import models
from django.db.models import Q
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
from model_utils.models import TimeStampedModel
from ordered_model.models import OrderedModel, Orde... | true | true |
1c17134ee5892a914f9f91166a5f9328a50533c1 | 5,808 | py | Python | test.py | cnrpman/HBMP | ae47bd737d88657f7f9284b2dd1adc96e535bbd9 | [
"MIT"
] | 75 | 2018-09-11T06:52:03.000Z | 2021-10-03T14:27:05.000Z | test.py | cnrpman/HBMP | ae47bd737d88657f7f9284b2dd1adc96e535bbd9 | [
"MIT"
] | 11 | 2018-09-11T01:49:31.000Z | 2021-06-09T04:02:20.000Z | test.py | cnrpman/HBMP | ae47bd737d88657f7f9284b2dd1adc96e535bbd9 | [
"MIT"
] | 17 | 2018-09-30T06:30:15.000Z | 2021-04-01T08:04:41.000Z | import numpy as np
import sys
from argparse import ArgumentParser
import torch
import random
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchtext import data
from torchtext import datasets
from corpora import MultiNLI, SciTail, StanfordNLI, AllNLI, BreakingNLI
parser = ... | 39.243243 | 123 | 0.594353 | import numpy as np
import sys
from argparse import ArgumentParser
import torch
import random
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchtext import data
from torchtext import datasets
from corpora import MultiNLI, SciTail, StanfordNLI, AllNLI, BreakingNLI
parser = ... | true | true |
1c17149ace6523781939343ed1fbbb973ee0250b | 3,843 | py | Python | telethon/tl/custom/file.py | SlavikMIPT/Telethon | fece5660f46b1f5b8f464c162914cc51bff6550f | [
"MIT"
] | 1 | 2019-06-21T19:19:50.000Z | 2019-06-21T19:19:50.000Z | telethon/tl/custom/file.py | SlavikMIPT/Telethon | fece5660f46b1f5b8f464c162914cc51bff6550f | [
"MIT"
] | 1 | 2020-06-30T20:56:35.000Z | 2020-06-30T20:56:35.000Z | telethon/tl/custom/file.py | SlavikMIPT/Telethon | fece5660f46b1f5b8f464c162914cc51bff6550f | [
"MIT"
] | null | null | null | import mimetypes
import os
from ... import utils
from ...tl import types
class File:
"""
Convenience class over media like photos or documents, which
supports accessing the attributes in a more convenient way.
If any of the attributes are not present in the current media,
the properties will be ... | 28.051095 | 84 | 0.596409 | import mimetypes
import os
from ... import utils
from ...tl import types
class File:
def __init__(self, media):
self.media = media
@property
def id(self):
return utils.pack_bot_file_id(self.media)
@property
def name(self):
return self._from_attr(types.DocumentAttributeFi... | true | true |
1c1715c590ccb15e9982de4a642f3e730b21b8d4 | 133 | py | Python | rxn4chemistry/__init__.py | jy8418/rxn4chemistry | 716ee0982a5f0ea9c2c9a80ae7538a0ca8e38b31 | [
"MIT"
] | 82 | 2020-04-06T17:48:15.000Z | 2022-03-21T09:23:22.000Z | rxn4chemistry/__init__.py | jy8418/rxn4chemistry | 716ee0982a5f0ea9c2c9a80ae7538a0ca8e38b31 | [
"MIT"
] | 23 | 2020-04-06T18:40:37.000Z | 2022-02-10T18:40:50.000Z | rxn4chemistry/__init__.py | jy8418/rxn4chemistry | 716ee0982a5f0ea9c2c9a80ae7538a0ca8e38b31 | [
"MIT"
] | 23 | 2020-04-16T16:58:41.000Z | 2022-03-21T09:23:25.000Z | """rxn4chemistry initialization."""
__name__ = "RXN4Chemistry"
__version__ = "1.0.1"
from .core import RXN4ChemistryWrapper # noqa
| 22.166667 | 46 | 0.75188 | __name__ = "RXN4Chemistry"
__version__ = "1.0.1"
from .core import RXN4ChemistryWrapper | true | true |
1c1715ce35dbd1f9c707842fa51580d56b007e10 | 760 | py | Python | zappar/users/migrations/0002_auto_20190925_1551.py | Konstantin-Bozhkov/zappar-random | ba9a0ae91bd74d7f01d43f467a783fa74a831e64 | [
"MIT"
] | null | null | null | zappar/users/migrations/0002_auto_20190925_1551.py | Konstantin-Bozhkov/zappar-random | ba9a0ae91bd74d7f01d43f467a783fa74a831e64 | [
"MIT"
] | 14 | 2020-06-05T23:33:27.000Z | 2022-02-26T18:16:21.000Z | zappar/users/migrations/0002_auto_20190925_1551.py | Konstantin-Bozhkov/zappar-random | ba9a0ae91bd74d7f01d43f467a783fa74a831e64 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-25 14:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='zapparusers',
options={'verbose_name':... | 27.142857 | 100 | 0.584211 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='zapparusers',
options={'verbose_name': 'Zappar API users', 'verbose_name_plural': 'Zap... | true | true |
1c1715e0efb648ba768b1f9069ec2b0f91865a04 | 538 | py | Python | titanic_forros/scripts/predict.py | davidpb90/titanic_forros | df4db64d96c187526236b599436c0503c0f83399 | [
"MIT"
] | 1 | 2021-01-19T21:47:47.000Z | 2021-01-19T21:47:47.000Z | titanic_forros/scripts/predict.py | davidpb90/titanic_forros | df4db64d96c187526236b599436c0503c0f83399 | [
"MIT"
] | null | null | null | titanic_forros/scripts/predict.py | davidpb90/titanic_forros | df4db64d96c187526236b599436c0503c0f83399 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module is for running predictions.
Examples:
Example command line executable::
$ python predict.py
"""
import logging
import click
from Titanic_Forros.util.logging import setup_logging_env
logger = logging.getLogger(__name__)
@click.command()
@setup_logging_env
def ma... | 14.944444 | 74 | 0.659851 | import logging
import click
from Titanic_Forros.util.logging import setup_logging_env
logger = logging.getLogger(__name__)
@click.command()
@setup_logging_env
def main():
logger.info("Predicting")
if __name__ == "__main__":
main()
| true | true |
1c171881083413da74e88704a8a47ff4395ef109 | 4,484 | py | Python | sphinxext/mathmpl.py | zmoon/scipy-lecture-notes | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | [
"CC-BY-4.0"
] | 2,538 | 2015-01-01T04:58:41.000Z | 2022-03-31T21:06:05.000Z | sphinxext/mathmpl.py | zmoon/scipy-lecture-notes | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | [
"CC-BY-4.0"
] | 362 | 2015-01-18T14:16:23.000Z | 2021-11-18T16:24:34.000Z | sphinxext/mathmpl.py | zmoon/scipy-lecture-notes | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | [
"CC-BY-4.0"
] | 1,127 | 2015-01-05T14:39:29.000Z | 2022-03-25T08:38:39.000Z | import os
try:
from hashlib import md5
except ImportError:
from md5 import md5
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.writers.html4css1 import HTMLTranslator
from sphinx.latexwriter import LaTeXTranslator
import warnings
# Define LaTeX math node:
class latex_math(... | 32.729927 | 73 | 0.653434 | import os
try:
from hashlib import md5
except ImportError:
from md5 import md5
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.writers.html4css1 import HTMLTranslator
from sphinx.latexwriter import LaTeXTranslator
import warnings
class latex_math(nodes.General, nodes.Eleme... | true | true |
1c171884e57c47529ebd48312c4283ba98b2b00b | 1,094 | py | Python | tests/test_graphical_units/test_brace.py | Hari-07/manim | bbe113e7d33636c8901d6c7cee81cb2f4b69cc8b | [
"MIT"
] | 1 | 2021-07-03T14:18:38.000Z | 2021-07-03T14:18:38.000Z | tests/test_graphical_units/test_brace.py | Hari-07/manim | bbe113e7d33636c8901d6c7cee81cb2f4b69cc8b | [
"MIT"
] | 3 | 2020-07-14T02:46:11.000Z | 2020-09-09T15:15:55.000Z | tests/test_graphical_units/test_brace.py | Hari-07/manim | bbe113e7d33636c8901d6c7cee81cb2f4b69cc8b | [
"MIT"
] | null | null | null | import pytest
from manim import *
from ..utils.GraphicalUnitTester import GraphicalUnitTester
from ..utils.testing_utils import get_scenes_to_test
class BraceSharpnessTest(Scene):
def construct(self):
line = Line(LEFT * 3, RIGHT * 3).shift(UP * 4)
for sharpness in [0, 0.25, 0.5, 0.75, 1, 2, 3, ... | 28.789474 | 88 | 0.640768 | import pytest
from manim import *
from ..utils.GraphicalUnitTester import GraphicalUnitTester
from ..utils.testing_utils import get_scenes_to_test
class BraceSharpnessTest(Scene):
def construct(self):
line = Line(LEFT * 3, RIGHT * 3).shift(UP * 4)
for sharpness in [0, 0.25, 0.5, 0.75, 1, 2, 3, ... | true | true |
1c1718cdda32add58a4437019746da519961c389 | 21,508 | py | Python | sdk/python/pulumi_azure_native/network/v20181201/express_route_port.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20181201/express_route_port.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20181201/express_route_port.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 47.584071 | 2,822 | 0.669193 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['ExpressRoutePortArgs', 'ExpressRoutePort']
@pulumi.input_type
class ExpressRoutePortArgs:
... | true | true |
1c171947480eced5db02f84cd08f53f06bf09a29 | 828 | py | Python | md/migrations/0003_stop_purpose.py | OpenDataPolicingNC/Traffic-Stops | 74e0d16ad2ac32addca6f04d34c2ddf36d023990 | [
"MIT"
] | 25 | 2015-09-12T23:10:52.000Z | 2021-03-24T08:39:46.000Z | md/migrations/0003_stop_purpose.py | OpenDataPolicingNC/Traffic-Stops | 74e0d16ad2ac32addca6f04d34c2ddf36d023990 | [
"MIT"
] | 159 | 2015-07-01T03:57:23.000Z | 2021-04-17T21:09:19.000Z | md/migrations/0003_stop_purpose.py | copelco/NC-Traffic-Stops | 74e0d16ad2ac32addca6f04d34c2ddf36d023990 | [
"MIT"
] | 8 | 2015-10-02T16:56:40.000Z | 2020-10-18T01:16:29.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('md', '0002_auto_20160623_1209'),
]
operations = [
migrations.AddField(
model_name='stop',
name='purp... | 41.4 | 484 | 0.650966 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('md', '0002_auto_20160623_1209'),
]
operations = [
migrations.AddField(
model_name='stop',
name='purpose',
field=... | true | true |
1c17197b09484a8accf0bf3d0806ca29fbed04cc | 4,962 | py | Python | scripts/api/data_manager_example_execute.py | igorhollaender/sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 2 | 2018-10-14T16:42:39.000Z | 2018-10-14T16:42:41.000Z | scripts/api/data_manager_example_execute.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | null | null | null | scripts/api/data_manager_example_execute.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
# Dan Blankenberg
# Very simple example of using the API to run Data Managers
# Script makes the naive assumption that dbkey==sequence id, which in many cases is not true nor desired
# *** This script is not recommended for use as-is on a production server ***
import optparse
import time
import ur... | 47.711538 | 232 | 0.67896 | import optparse
import time
import urlparse
from common import get, post
DEFAULT_SLEEP_TIME = 3
FETCH_GENOME_TOOL_ID = 'testtoolshed.g2.bx.psu.edu/repos/blankenberg/data_manager_fetch_genome_all_fasta/data_manager_fetch_genome_all_fasta/0.0.1'
BUILD_INDEX_TOOLS_ID = [ 'testtoolshed.g2.bx.psu.edu/repos/blankenberg/dat... | false | true |
1c171b5eacf36c5954e2163b782b7fd35dddfbc3 | 28 | py | Python | container/src/views/__init__.py | PowercoderJr/oonote | 619e7a0146c0239232b3d9a7effe597ab899b88e | [
"MIT"
] | null | null | null | container/src/views/__init__.py | PowercoderJr/oonote | 619e7a0146c0239232b3d9a7effe597ab899b88e | [
"MIT"
] | null | null | null | container/src/views/__init__.py | PowercoderJr/oonote | 619e7a0146c0239232b3d9a7effe597ab899b88e | [
"MIT"
] | null | null | null | from . import general, note
| 14 | 27 | 0.75 | from . import general, note
| true | true |
1c171c3e2c2f9682a6cee7ce09c80263c5cbeae3 | 743 | py | Python | elvaapp/reproduction/doctype/velage/velage.py | ovresko/elvadesk | 10090244ce5bd379cf16763e216e6011870de937 | [
"MIT"
] | 1 | 2020-12-28T16:35:41.000Z | 2020-12-28T16:35:41.000Z | elvaapp/reproduction/doctype/velage/velage.py | ovresko/elvadesk | 10090244ce5bd379cf16763e216e6011870de937 | [
"MIT"
] | null | null | null | elvaapp/reproduction/doctype/velage/velage.py | ovresko/elvadesk | 10090244ce5bd379cf16763e216e6011870de937 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, ovresko tech and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Velage(Document):
def validate(self):
if( self.resultat == 'Succée' and len(self.veau)... | 39.105263 | 124 | 0.728129 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Velage(Document):
def validate(self):
if( self.resultat == 'Succée' and len(self.veau) < 1):
frappe.throw("Il faut insérer le/les veau(x) née(s)")
vache = frappe.get_doc('Vache',self.vache)
if(vache.etat_r... | true | true |
1c171cebe8fc8615a9268b8956e5db1c4a89181f | 1,605 | py | Python | foundationdb/datadog_checks/foundationdb/config_models/instance.py | davidlrosenblum/integrations-extras | 281864a99ae054c91c3e3ea6a8ee8f04f6d7cdf3 | [
"BSD-3-Clause"
] | 1 | 2021-10-04T17:03:54.000Z | 2021-10-04T17:03:54.000Z | foundationdb/datadog_checks/foundationdb/config_models/instance.py | davidlrosenblum/integrations-extras | 281864a99ae054c91c3e3ea6a8ee8f04f6d7cdf3 | [
"BSD-3-Clause"
] | null | null | null | foundationdb/datadog_checks/foundationdb/config_models/instance.py | davidlrosenblum/integrations-extras | 281864a99ae054c91c3e3ea6a8ee8f04f6d7cdf3 | [
"BSD-3-Clause"
] | 1 | 2021-10-04T17:09:09.000Z | 2021-10-04T17:09:09.000Z | from __future__ import annotations
from typing import Any, Mapping, Optional, Sequence
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_checks.base.utils.models import validation
from . import defaults, validators
class InstanceConfig(... | 31.470588 | 110 | 0.723364 | from __future__ import annotations
from typing import Any, Mapping, Optional, Sequence
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_checks.base.utils.models import validation
from . import defaults, validators
class InstanceConfig(... | true | true |
1c171df27b3f526162f867cbb48610f820caf91d | 464 | py | Python | client/verta/verta/configuration/_configuration.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | null | null | null | client/verta/verta/configuration/_configuration.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | null | null | null | client/verta/verta/configuration/_configuration.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
from .._protos.public.modeldb.versioning import Config_pb2 as _ConfigService
from ..repository import _blob
class _Configuration(_blob.Blob):
"""
Base class for configuration versioning. Not for human consumption.
"""
def __init__(self)... | 23.2 | 76 | 0.700431 |
from __future__ import print_function
from .._protos.public.modeldb.versioning import Config_pb2 as _ConfigService
from ..repository import _blob
class _Configuration(_blob.Blob):
def __init__(self):
super(_Configuration, self).__init__()
self._msg = _ConfigService.ConfigBlob()
| true | true |
1c171ed999fbf5a88b3e7332109e4a806193f215 | 865 | py | Python | particlezoo/diagrams/node.py | npapapietro/particlezoo | f4a42fedd9f3a4ed10ae5926d217e3966a733a32 | [
"MIT"
] | null | null | null | particlezoo/diagrams/node.py | npapapietro/particlezoo | f4a42fedd9f3a4ed10ae5926d217e3966a733a32 | [
"MIT"
] | null | null | null | particlezoo/diagrams/node.py | npapapietro/particlezoo | f4a42fedd9f3a4ed10ae5926d217e3966a733a32 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import NamedTuple
from ..builders import Field
class Node(NamedTuple):
key: str
class Diagram:
def __init__(
self,
n_points: int,
in_fields: list[Field],
out_fields: list[Field]):
self.n_points = n_poi... | 24.714286 | 77 | 0.606936 | from __future__ import annotations
from typing import NamedTuple
from ..builders import Field
class Node(NamedTuple):
key: str
class Diagram:
def __init__(
self,
n_points: int,
in_fields: list[Field],
out_fields: list[Field]):
self.n_points = n_poi... | true | true |
1c171f191f6ba26ec7280db6e31e668ef11f0bef | 1,106 | py | Python | compss/programming_model/bindings/python/src/pycompss/api/dummy/compss.py | ramonamela/compss | 3b36b4264ac5f58476f5b89a452d9200b4702020 | [
"Apache-2.0"
] | 2 | 2018-05-07T16:04:51.000Z | 2018-05-08T12:14:19.000Z | compss/programming_model/bindings/python/src/pycompss/api/dummy/compss.py | ramonamela/compss | 3b36b4264ac5f58476f5b89a452d9200b4702020 | [
"Apache-2.0"
] | 4 | 2017-10-25T12:20:52.000Z | 2019-03-20T14:17:40.000Z | compss/programming_model/bindings/python/src/pycompss/api/dummy/compss.py | mF2C/COMPSs | a74d97346121382a8a40ca15fa619e6e4cea917f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 26.97561 | 75 | 0.663653 |
class COMPSs(object):
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
def __call__(self, f):
def wrapped_f(*args, **kwargs):
return f(*args, **kwargs)
return wrapped_f
| true | true |
1c172191b39e00d3e85220667784ca87cef77717 | 1,879 | py | Python | src/proteins/test/test_argument_converter.py | isaachenrion/jets | 59aeba81788d0741af448192d9dfb764fb97cf8d | [
"BSD-3-Clause"
] | 9 | 2017-10-09T17:01:52.000Z | 2018-06-12T18:06:05.000Z | src/proteins/test/test_argument_converter.py | isaachenrion/jets | 59aeba81788d0741af448192d9dfb764fb97cf8d | [
"BSD-3-Clause"
] | 31 | 2017-11-01T14:39:02.000Z | 2018-04-18T15:34:24.000Z | src/proteins/test/test_argument_converter.py | isaachenrion/jets | 59aeba81788d0741af448192d9dfb764fb97cf8d | [
"BSD-3-Clause"
] | 10 | 2017-10-17T19:23:14.000Z | 2020-07-05T04:44:45.000Z | import os
from .test_monitors import test_monitor_collection
def test_argument_converter(args):
'''
Takes an argparse namespace, and converts it into argument dictionaries.
Each argument dictionary is fed into a specific function or class in the
training script. e.g. admin_kwargs is the set of argument... | 26.464789 | 76 | 0.640234 | import os
from .test_monitors import test_monitor_collection
def test_argument_converter(args):
if args.debug:
args.email = None
args.verbose = True
args.batch_size = 3
args.epochs = 15
args.lr = 0.1
args.period = 2
args.seed = 1
args.hidden = 1
... | true | true |
1c1722393deed4e902659863272aef066e88a8e1 | 420 | py | Python | day6/warm-up-day-6-ex2-solution.py | btardio/dataviz_warmups | 6eca22f9a722766941ddbf203a5d5a3044c09a48 | [
"MIT"
] | null | null | null | day6/warm-up-day-6-ex2-solution.py | btardio/dataviz_warmups | 6eca22f9a722766941ddbf203a5d5a3044c09a48 | [
"MIT"
] | null | null | null | day6/warm-up-day-6-ex2-solution.py | btardio/dataviz_warmups | 6eca22f9a722766941ddbf203a5d5a3044c09a48 | [
"MIT"
] | null | null | null | #
# Assuming an ordering or rows from 0 to 3, fix the following lists being told
# that row0's a column is 0 and row 2's d column is 0. Use columnX.insert()
#
column0 = ['a',9,3,6]
column1 = ['b',4,4,3,4]
column2 = ['c',7,4,4,3]
column3 = ['d',2,3,2]
print(list(zip(column0, column1, column2, column3)))
... | 24.705882 | 80 | 0.642857 |
column0 = ['a',9,3,6]
column1 = ['b',4,4,3,4]
column2 = ['c',7,4,4,3]
column3 = ['d',2,3,2]
print(list(zip(column0, column1, column2, column3)))
column0.insert(1, 0)
column3.insert(3, 0)
print(list(zip(column0, column1, column2, column3)))
| true | true |
1c1723946f51b02378a9873e5ab1832dc7b30411 | 32 | py | Python | hello.py | fadumoaideed/whatsapp-bot | acae33607a59dedcf178659e82d380db84727d4f | [
"MIT"
] | null | null | null | hello.py | fadumoaideed/whatsapp-bot | acae33607a59dedcf178659e82d380db84727d4f | [
"MIT"
] | null | null | null | hello.py | fadumoaideed/whatsapp-bot | acae33607a59dedcf178659e82d380db84727d4f | [
"MIT"
] | null | null | null | msg = "Hello World!"
print(msg) | 16 | 21 | 0.65625 | msg = "Hello World!"
print(msg) | true | true |
1c172519d87dfb3a2ab99611f2f736dc53c07d1c | 570 | py | Python | backend/util/count_chars.py | rsimmons/massif | d97ee63f618e0d05308722158992f804e2c54fa5 | [
"MIT"
] | 24 | 2021-06-20T16:54:14.000Z | 2022-03-31T03:46:13.000Z | backend/util/count_chars.py | rsimmons/massif | d97ee63f618e0d05308722158992f804e2c54fa5 | [
"MIT"
] | 6 | 2021-07-04T14:49:38.000Z | 2022-03-27T09:19:58.000Z | backend/util/count_chars.py | rsimmons/massif | d97ee63f618e0d05308722158992f804e2c54fa5 | [
"MIT"
] | 1 | 2021-08-25T14:31:22.000Z | 2021-08-25T14:31:22.000Z | import unicodedata
import sys
tbl = dict.fromkeys(i for i in range(sys.maxunicode) if chr(i).isspace() or unicodedata.category(chr(i)).startswith('P') or unicodedata.category(chr(i)).startswith('S'))
def remove_spaces_punctuation(text):
return text.translate(tbl)
def count_meaty_chars(text):
return len(remov... | 31.666667 | 169 | 0.745614 | import unicodedata
import sys
tbl = dict.fromkeys(i for i in range(sys.maxunicode) if chr(i).isspace() or unicodedata.category(chr(i)).startswith('P') or unicodedata.category(chr(i)).startswith('S'))
def remove_spaces_punctuation(text):
return text.translate(tbl)
def count_meaty_chars(text):
return len(remov... | true | true |
1c17251e18fca3f8a531411ddabda3ed292025c5 | 16,659 | py | Python | mmdet/models/backbones/dla.py | sokunmin/mmdetection | 2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/dla.py | sokunmin/mmdetection | 2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/dla.py | sokunmin/mmdetection | 2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb | [
"Apache-2.0"
] | null | null | null | import os
import torch.nn as nn
from mmcv.cnn import constant_init, kaiming_init
from mmcv.ops import ModulatedDeformConv2dPack
from mmcv.runner import load_checkpoint
from ..builder import BACKBONES
import math
import logging
import numpy as np
from os.path import join
import torch
from torch import nn
import torc... | 35.369427 | 96 | 0.537367 | import os
import torch.nn as nn
from mmcv.cnn import constant_init, kaiming_init
from mmcv.ops import ModulatedDeformConv2dPack
from mmcv.runner import load_checkpoint
from ..builder import BACKBONES
import math
import logging
import numpy as np
from os.path import join
import torch
from torch import nn
import torc... | true | true |
1c1725597da98e27cadd5ad552179b401717faff | 145 | py | Python | tests/context.py | fillet54/qroutes | b411b19d6d9a45227ab7f6fab569c2571bef412a | [
"MIT"
] | null | null | null | tests/context.py | fillet54/qroutes | b411b19d6d9a45227ab7f6fab569c2571bef412a | [
"MIT"
] | null | null | null | tests/context.py | fillet54/qroutes | b411b19d6d9a45227ab7f6fab569c2571bef412a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import qroutes
| 18.125 | 82 | 0.675862 |
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import qroutes
| true | true |
1c17262bf4a75acac4e8f825c561929d35b71838 | 660 | py | Python | tests/riscv/address_solving/_def_fctrl.py | jeremybennett/force-riscv | a5222a3b3fa8a0b9464204056ddca148f16b7e49 | [
"Apache-2.0"
] | null | null | null | tests/riscv/address_solving/_def_fctrl.py | jeremybennett/force-riscv | a5222a3b3fa8a0b9464204056ddca148f16b7e49 | [
"Apache-2.0"
] | null | null | null | tests/riscv/address_solving/_def_fctrl.py | jeremybennett/force-riscv | a5222a3b3fa8a0b9464204056ddca148f16b7e49 | [
"Apache-2.0"
] | 1 | 2020-06-17T09:37:45.000Z | 2020-06-17T09:37:45.000Z | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... | 34.736842 | 87 | 0.737879 | control_items = [
{"fname": "*_force.py"},
]
| true | true |
1c1727329874ae043ea8444a5663f67ce324485b | 13,582 | py | Python | scripts/mustpass.py | tarceri/VK-GL-CTS | 22389a0e44f458492f594ca0553a5a67cf6c7ada | [
"Apache-2.0"
] | 1 | 2021-03-21T10:43:16.000Z | 2021-03-21T10:43:16.000Z | scripts/mustpass.py | tarceri/VK-GL-CTS | 22389a0e44f458492f594ca0553a5a67cf6c7ada | [
"Apache-2.0"
] | null | null | null | scripts/mustpass.py | tarceri/VK-GL-CTS | 22389a0e44f458492f594ca0553a5a67cf6c7ada | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | 32.261283 | 145 | 0.729127 |
from build.common import *
from build.config import ANY_GENERATOR
from build.build import build
from build_caselists import Module, getModuleByName, getBuildConfig, genCaseList, getCaseListPath, DEFAULT_BUILD_DIR, DEFAULT_TARGET
from fnmatch import fnmatch
from copy import copy
import argparse
import xml.etree.cElem... | true | true |
1c1727878205e8c12e11c1fd2c6d6369ffb2f121 | 12,207 | py | Python | week_4.py | surfgreen/python_automation | 94e3548a8139ed0fe3e3ad3ded1f0f899327d1d6 | [
"Apache-2.0"
] | null | null | null | week_4.py | surfgreen/python_automation | 94e3548a8139ed0fe3e3ad3ded1f0f899327d1d6 | [
"Apache-2.0"
] | null | null | null | week_4.py | surfgreen/python_automation | 94e3548a8139ed0fe3e3ad3ded1f0f899327d1d6 | [
"Apache-2.0"
] | null | null | null | import sys
from pprint import pprint
# Python Libraries and PIP
"""
# how to rename a function that you are importing
from re import search as my_search
my_search() # this is the new name for re
# when using pip look how active the project is
# pip install <library name>
# can use pip to install older packages
# c... | 30.140741 | 119 | 0.719833 | import sys
from pprint import pprint
| true | true |
1c172795708e36143086bbf47835882392c679aa | 3,105 | py | Python | cptr_model/models/cptr/mlp/mlp.py | jsoft88/cptr-vision-transformer | c1728792e3a1b14805ad2489efcd869677c380d7 | [
"MIT"
] | null | null | null | cptr_model/models/cptr/mlp/mlp.py | jsoft88/cptr-vision-transformer | c1728792e3a1b14805ad2489efcd869677c380d7 | [
"MIT"
] | null | null | null | cptr_model/models/cptr/mlp/mlp.py | jsoft88/cptr-vision-transformer | c1728792e3a1b14805ad2489efcd869677c380d7 | [
"MIT"
] | null | null | null | from typing import Any, OrderedDict
import torch.nn
from pytorch_lightning import LightningModule
from cptr_model.core.core_module_extension import CoreModuleExtension
class MLP(torch.nn.Module, CoreModuleExtension):
KEY_LATENT_DIM = 'latent-dim'
KEY_MLP_DIM = 'mlp-dim'
KEY_DROPOUT_RATE = 'dropout-rate'
... | 38.333333 | 86 | 0.668277 | from typing import Any, OrderedDict
import torch.nn
from pytorch_lightning import LightningModule
from cptr_model.core.core_module_extension import CoreModuleExtension
class MLP(torch.nn.Module, CoreModuleExtension):
KEY_LATENT_DIM = 'latent-dim'
KEY_MLP_DIM = 'mlp-dim'
KEY_DROPOUT_RATE = 'dropout-rate'
... | true | true |
1c172974339a30f4f1cfa12b5ef619f52fc020d4 | 1,516 | py | Python | tests/test_handle_move.py | gaphor/gaphas | 084a55d31483e895ff26ee4d1f7861a690f25303 | [
"Apache-2.0"
] | 108 | 2018-01-09T00:19:04.000Z | 2022-03-25T05:24:12.000Z | tests/test_handle_move.py | gaphor/gaphas | 084a55d31483e895ff26ee4d1f7861a690f25303 | [
"Apache-2.0"
] | 134 | 2018-01-10T03:01:27.000Z | 2022-03-19T19:40:03.000Z | tests/test_handle_move.py | gaphor/gaphas | 084a55d31483e895ff26ee4d1f7861a690f25303 | [
"Apache-2.0"
] | 17 | 2018-01-09T02:20:05.000Z | 2021-12-17T18:03:09.000Z | from gaphas.aspect.handlemove import ItemHandleMove
def test_can_connect(line, box, connections, view):
handle_move = ItemHandleMove(line, line.head, view)
handle_move.connect((0, 0))
assert connections.get_connection(line.head)
def test_handle_is_connected_and_constraint_removed_when_moved(
line, ... | 29.153846 | 69 | 0.75066 | from gaphas.aspect.handlemove import ItemHandleMove
def test_can_connect(line, box, connections, view):
handle_move = ItemHandleMove(line, line.head, view)
handle_move.connect((0, 0))
assert connections.get_connection(line.head)
def test_handle_is_connected_and_constraint_removed_when_moved(
line, ... | true | true |
1c17297c49ea2240fba7ce9b870129d4c23654bf | 3,376 | py | Python | Code/BaselineAlgorithms/sumy/parsers/plaintext.py | tafseer-nayeem/BengaliSummarization | 31334d12bd6bbd2db92f4b0ecc436e006cb96fd8 | [
"MIT"
] | 4 | 2021-07-11T05:08:12.000Z | 2022-01-23T08:34:51.000Z | Code/BaselineAlgorithms/sumy/parsers/plaintext.py | tafseer-nayeem/BengaliSummarization | 31334d12bd6bbd2db92f4b0ecc436e006cb96fd8 | [
"MIT"
] | null | null | null | Code/BaselineAlgorithms/sumy/parsers/plaintext.py | tafseer-nayeem/BengaliSummarization | 31334d12bd6bbd2db92f4b0ecc436e006cb96fd8 | [
"MIT"
] | 4 | 2021-03-07T12:32:58.000Z | 2022-02-04T19:11:19.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from io import open
"""
from .parser import DocumentParser
from .._compat import to_unicode
from ..models.dom import ObjectDocumentModel, Paragraph, Sentence
from ..utils import cached_prop... | 30.690909 | 93 | 0.646327 |
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from io import open
from Python.baselineAlgorithm.sumy.parsers.parser import DocumentParser
from Python.baselineAlgorithm.sumy._compat import to_unicode
from Python.baselineAlgorithm.sumy.models.dom import ObjectD... | true | true |
1c172998e90200534eed203d783e76b445dc4189 | 467 | py | Python | OpenDataCatalog/suggestions/urls.py | runonthespot/Open-Data-Catalog | 5fca499b383279a511188d5e05190b46d37fdaad | [
"MIT"
] | 105 | 2015-01-11T19:08:03.000Z | 2022-03-09T12:58:39.000Z | OpenDataCatalog/suggestions/urls.py | runonthespot/Open-Data-Catalog | 5fca499b383279a511188d5e05190b46d37fdaad | [
"MIT"
] | 3 | 2017-08-23T15:12:39.000Z | 2019-03-06T22:58:35.000Z | OpenDataCatalog/suggestions/urls.py | runonthespot/Open-Data-Catalog | 5fca499b383279a511188d5e05190b46d37fdaad | [
"MIT"
] | 40 | 2015-05-18T01:25:08.000Z | 2022-03-09T02:14:27.000Z | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
(r'^$', 'OpenDataCatalog.suggestions.views.list_all'),
(r'^post/$', 'OpenDataCatalog.suggestions.views.add_suggestion'),
(r'^vote/(?P<suggestion_id>.*)/$', 'OpenDataCatalog.suggestions.views.add_vote'),
(r'^unvote/(?P<suggestion... | 46.7 | 89 | 0.702355 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
(r'^$', 'OpenDataCatalog.suggestions.views.list_all'),
(r'^post/$', 'OpenDataCatalog.suggestions.views.add_suggestion'),
(r'^vote/(?P<suggestion_id>.*)/$', 'OpenDataCatalog.suggestions.views.add_vote'),
(r'^unvote/(?P<suggestion... | true | true |
1c1729a39e4561b4fd532282f42c328fd6e2322d | 1,139 | py | Python | main/data_reader.py | gajduk/yeast-johan-assay-data-analysis | 1513da43fa3b8ce49a39a9cdb2222c9c0ef01342 | [
"MIT"
] | null | null | null | main/data_reader.py | gajduk/yeast-johan-assay-data-analysis | 1513da43fa3b8ce49a39a9cdb2222c9c0ef01342 | [
"MIT"
] | null | null | null | main/data_reader.py | gajduk/yeast-johan-assay-data-analysis | 1513da43fa3b8ce49a39a9cdb2222c9c0ef01342 | [
"MIT"
] | null | null | null | import xlrd
import os
PROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),'..')
class DataReader:
_default_datafile = os.path.join(PROJECT_DIR,'data','matingassay.xlsx')
def __init__(self):
pass
def load(self,file_=_default_datafile):
book = xlrd.open_workbook(file_)
... | 28.475 | 117 | 0.579456 | import xlrd
import os
PROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),'..')
class DataReader:
_default_datafile = os.path.join(PROJECT_DIR,'data','matingassay.xlsx')
def __init__(self):
pass
def load(self,file_=_default_datafile):
book = xlrd.open_workbook(file_)
... | true | true |
1c1729cd2c345b0722ce0b9044174f5d05248bd2 | 5,620 | py | Python | util/new_replay_buffers/hybird_fifo_cur_res/curious_reservoir_replay_buffer.py | punk95/Continual-Learning-With-Curiosity | af0c507040e1352beb8740b6b3a7849417fc879a | [
"MIT"
] | 2 | 2021-07-12T17:11:35.000Z | 2021-07-13T05:56:30.000Z | util/new_replay_buffers/hybird_fifo_cur_res/curious_reservoir_replay_buffer.py | punk95/Continual-Learning-With-Curiosity | af0c507040e1352beb8740b6b3a7849417fc879a | [
"MIT"
] | null | null | null | util/new_replay_buffers/hybird_fifo_cur_res/curious_reservoir_replay_buffer.py | punk95/Continual-Learning-With-Curiosity | af0c507040e1352beb8740b6b3a7849417fc879a | [
"MIT"
] | null | null | null | import numpy as np
import heapq
import random
from itertools import count
import torch
class Transition_tuple():
def __init__(self, state, action, action_mean, reward, curiosity, next_state, done_mask, t):
#expects as list of items for each initalization variable
self.state = np.array(state)
... | 31.396648 | 129 | 0.585231 | import numpy as np
import heapq
import random
from itertools import count
import torch
class Transition_tuple():
def __init__(self, state, action, action_mean, reward, curiosity, next_state, done_mask, t):
self.state = np.array(state)
self.action = np.array(action)
self.action_mean ... | true | true |
1c172a9683e268005f36933bd461b82ac7222c47 | 3,208 | py | Python | SLU/extract_flowbert_features.py | formiel/NeurIPS2021 | a2a29a1904779c3ffd1a002fd057bf90b31a234d | [
"MIT"
] | 48 | 2021-03-25T14:00:04.000Z | 2022-03-27T17:00:00.000Z | SLU/extract_flowbert_features.py | formiel/NeurIPS2021 | a2a29a1904779c3ffd1a002fd057bf90b31a234d | [
"MIT"
] | 2 | 2021-04-16T13:21:44.000Z | 2021-06-16T15:23:09.000Z | SLU/extract_flowbert_features.py | formiel/NeurIPS2021 | a2a29a1904779c3ffd1a002fd057bf90b31a234d | [
"MIT"
] | 8 | 2021-09-09T14:49:14.000Z | 2022-03-03T15:53:09.000Z |
import os
import sys
from scipy import signal
from scipy.io import wavfile
import torch
import fairseq
import torch.nn.functional as F
from fairseq.models.wav2vec.wav2vec2_asr import Wav2VecCtc
upsample = True
cuda = False
extract_features=True
model_size = 'large'
add_ext=True
file_ext = '.xlsr53-sv'
overwrite_arg... | 32.734694 | 127 | 0.675187 |
import os
import sys
from scipy import signal
from scipy.io import wavfile
import torch
import fairseq
import torch.nn.functional as F
from fairseq.models.wav2vec.wav2vec2_asr import Wav2VecCtc
upsample = True
cuda = False
extract_features=True
model_size = 'large'
add_ext=True
file_ext = '.xlsr53-sv'
overwrite_arg... | true | true |
1c172aa373ee0f5d6bcb766be2abe42470b16b00 | 2,770 | py | Python | tests/PySys/software-management-end-to-end/sm-apt-install-remove-multiple/run.py | z8674558/thin-edge.io | 75650d05fc3eea0a3ccedc543d375dbe4b91b79c | [
"Apache-2.0"
] | 1 | 2021-11-29T16:42:40.000Z | 2021-11-29T16:42:40.000Z | tests/PySys/software-management-end-to-end/sm-apt-install-remove-multiple/run.py | Bilal3429/thin-edge.io | e0efd463884ac6d58f7387112f3fd7c9831feece | [
"Apache-2.0"
] | null | null | null | tests/PySys/software-management-end-to-end/sm-apt-install-remove-multiple/run.py | Bilal3429/thin-edge.io | e0efd463884ac6d58f7387112f3fd7c9831feece | [
"Apache-2.0"
] | null | null | null | from pysys.basetest import BaseTest
import time
"""
Validate end to end behaviour for the apt plugin for multiple packages
When we install a bunch of packages
Then they are installed
When we deinstall them again
Then they are not installed
"""
import json
import requests
import time
import sys
sys.path.append("sof... | 30.777778 | 85 | 0.591336 | from pysys.basetest import BaseTest
import time
import json
import requests
import time
import sys
sys.path.append("software-management-end-to-end")
from environment_sm_management import SoftwareManagement
class PySysTest(SoftwareManagement):
def get_packages_with_action(self, act):
action = [
... | true | true |
1c172aea069ec806e9e5dd5e0115ab75021f8661 | 2,821 | py | Python | src/prefect/utilities/agent.py | jspeis/prefect | 61154b21d2eaac21b7a597b6e9b63377ffffcb9a | [
"Apache-2.0"
] | 1 | 2022-03-19T06:11:03.000Z | 2022-03-19T06:11:03.000Z | src/prefect/utilities/agent.py | jspeis/prefect | 61154b21d2eaac21b7a597b6e9b63377ffffcb9a | [
"Apache-2.0"
] | null | null | null | src/prefect/utilities/agent.py | jspeis/prefect | 61154b21d2eaac21b7a597b6e9b63377ffffcb9a | [
"Apache-2.0"
] | null | null | null | from distutils.version import LooseVersion
from prefect.utilities.graphql import GraphQLResult
def get_flow_image(flow_run: GraphQLResult) -> str:
"""
Retrieve the image to use for this flow run deployment.
Args:
- flow_run (GraphQLResult): A GraphQLResult flow run object
Returns:
-... | 39.180556 | 93 | 0.686636 | from distutils.version import LooseVersion
from prefect.utilities.graphql import GraphQLResult
def get_flow_image(flow_run: GraphQLResult) -> str:
from prefect.storage import Docker
from prefect.serialization.storage import StorageSchema
from prefect.serialization.run_config import RunConfigSchema
fr... | true | true |
1c172b6c70d362dc1a856a5d74de9e4c3fbddd92 | 943 | py | Python | pseudo_cms/utils.py | madisona/django-pseudo-cms | d99d4e3b4b1fb543e4e31192236a5d502ee98984 | [
"BSD-3-Clause"
] | 1 | 2015-04-10T10:48:15.000Z | 2015-04-10T10:48:15.000Z | pseudo_cms/utils.py | madisona/django-pseudo-cms | d99d4e3b4b1fb543e4e31192236a5d502ee98984 | [
"BSD-3-Clause"
] | null | null | null | pseudo_cms/utils.py | madisona/django-pseudo-cms | d99d4e3b4b1fb543e4e31192236a5d502ee98984 | [
"BSD-3-Clause"
] | null | null | null | from docutils.core import publish_parts
from django.conf import settings
from django.utils.encoding import smart_str
from django.template.defaultfilters import linebreaksbr
HTML = u"html"
PLAIN_TEXT = u"text"
reST = u"reST"
CONTENT_FORMAT_CHOICES = (
(HTML, u'Raw HTML'),
(reST, u'reStructuredText'),
(PLAI... | 22.452381 | 60 | 0.693531 | from docutils.core import publish_parts
from django.conf import settings
from django.utils.encoding import smart_str
from django.template.defaultfilters import linebreaksbr
HTML = u"html"
PLAIN_TEXT = u"text"
reST = u"reST"
CONTENT_FORMAT_CHOICES = (
(HTML, u'Raw HTML'),
(reST, u'reStructuredText'),
(PLAI... | true | true |
1c172bfc75ec5e302d3deea3bcc6d11e42341547 | 367 | py | Python | yamtbx/command_line/kamo_auto_multi_merge_report.py | 7l2icj/kamo_clone | 5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6 | [
"BSD-3-Clause"
] | 16 | 2016-05-20T11:19:40.000Z | 2021-01-01T19:44:23.000Z | yamtbx/command_line/kamo_auto_multi_merge_report.py | 7l2icj/kamo_clone | 5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6 | [
"BSD-3-Clause"
] | 4 | 2017-03-10T00:51:11.000Z | 2021-02-07T17:18:46.000Z | yamtbx/command_line/kamo_auto_multi_merge_report.py | 7l2icj/kamo_clone | 5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6 | [
"BSD-3-Clause"
] | 9 | 2016-12-15T16:00:06.000Z | 2021-09-10T08:34:14.000Z | # LIBTBX_SET_DISPATCHER_NAME kamo.auto_multi_merge_report
"""
(c) RIKEN 2017. All rights reserved.
Author: Keitaro Yamashita
This software is released under the new BSD License; see LICENSE.
"""
from yamtbx.dataproc.auto.command_line import auto_multi_merge_report
if __name__ == "__main__":
import sys
auto_... | 26.214286 | 69 | 0.787466 |
from yamtbx.dataproc.auto.command_line import auto_multi_merge_report
if __name__ == "__main__":
import sys
auto_multi_merge_report.run_from_args(sys.argv[1:])
| true | true |
1c172c939362a2169802bfb8313a2379366a1386 | 5,685 | py | Python | parallel_main_gsonly_IH.py | boada/ICD | c1bfedf5f8e5b0e9f77c6d1194bf1e0266d7efd8 | [
"MIT"
] | null | null | null | parallel_main_gsonly_IH.py | boada/ICD | c1bfedf5f8e5b0e9f77c6d1194bf1e0266d7efd8 | [
"MIT"
] | null | null | null | parallel_main_gsonly_IH.py | boada/ICD | c1bfedf5f8e5b0e9f77c6d1194bf1e0266d7efd8 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
from ctypes import *
from functions import *
from math import sqrt
import numpy as np
import multiprocessing
import pyfits
import signal
# Load the library for the CFitsio routines
overseer = CDLL("/home/steven/Projects/galaxy_icd/libraries/liboverseer.so.0")
def main(sample):
naxes ... | 33.245614 | 92 | 0.612841 |
import sys
from ctypes import *
from functions import *
from math import sqrt
import numpy as np
import multiprocessing
import pyfits
import signal
overseer = CDLL("/home/steven/Projects/galaxy_icd/libraries/liboverseer.so.0")
def main(sample):
naxes = (c_long*2)(500,500)
base='/home/steven/Projects/image_fi... | false | true |
1c172cf5d29ed59587abad238c621a950c29a6ff | 7,190 | py | Python | app/make_vuzes_rating.py | DanilMus/ChooseVuzBot | 8e30592c3e8ff6c19800af8f4fcbaad5d1ffe155 | [
"MIT"
] | null | null | null | app/make_vuzes_rating.py | DanilMus/ChooseVuzBot | 8e30592c3e8ff6c19800af8f4fcbaad5d1ffe155 | [
"MIT"
] | null | null | null | app/make_vuzes_rating.py | DanilMus/ChooseVuzBot | 8e30592c3e8ff6c19800af8f4fcbaad5d1ffe155 | [
"MIT"
] | null | null | null | def vuzes_data_without_faculties_names(vuzes_data:dict):
for vuz_name, vuz_info in vuzes_data.items():
EGE_and_budPl = vuz_info[0]
EGE_and_budPl_of3max = vuz_info[1]
EGE = []
budPl = []
for val in EGE_and_budPl.values():
EGE.append(val[0])
budPl.appen... | 35.771144 | 123 | 0.615021 | def vuzes_data_without_faculties_names(vuzes_data:dict):
for vuz_name, vuz_info in vuzes_data.items():
EGE_and_budPl = vuz_info[0]
EGE_and_budPl_of3max = vuz_info[1]
EGE = []
budPl = []
for val in EGE_and_budPl.values():
EGE.append(val[0])
budPl.appen... | true | true |
1c172d503d82df5c6a750373f08b2441f6072639 | 4,290 | py | Python | tools/deploy.py | Konnichy/SmartThingsEdgeDrivers | b990344774084059ae5505e31f9c1970da633207 | [
"Apache-2.0"
] | 43 | 2021-08-19T16:52:13.000Z | 2022-03-28T14:56:45.000Z | tools/deploy.py | Konnichy/SmartThingsEdgeDrivers | b990344774084059ae5505e31f9c1970da633207 | [
"Apache-2.0"
] | 28 | 2021-08-20T19:10:22.000Z | 2022-03-24T08:18:04.000Z | tools/deploy.py | Konnichy/SmartThingsEdgeDrivers | b990344774084059ae5505e31f9c1970da633207 | [
"Apache-2.0"
] | 66 | 2021-08-24T13:06:42.000Z | 2022-03-24T13:48:54.000Z | import os, subprocess, requests, json, time, yaml, hashlib
ENVIRONMENT_URL = os.environ.get('ENVIRONMENT_URL')
UPLOAD_URL = ENVIRONMENT_URL+"/drivers/package"
CHANNEL_ID = os.environ.get('CHANNEL_ID')
UPDATE_URL = ENVIRONMENT_URL+"/channels/"+CHANNEL_ID+"/drivers/bulk"
TOKEN = os.environ.get('TOKEN')
DRIVERID = "drive... | 41.650485 | 168 | 0.677622 | import os, subprocess, requests, json, time, yaml, hashlib
ENVIRONMENT_URL = os.environ.get('ENVIRONMENT_URL')
UPLOAD_URL = ENVIRONMENT_URL+"/drivers/package"
CHANNEL_ID = os.environ.get('CHANNEL_ID')
UPDATE_URL = ENVIRONMENT_URL+"/channels/"+CHANNEL_ID+"/drivers/bulk"
TOKEN = os.environ.get('TOKEN')
DRIVERID = "drive... | true | true |
1c172d7f827f94334cd6a96959bf6a34d69897d8 | 1,748 | py | Python | coolplots/data.py | dylancromer/coolplots | 58ddfed2090af14d0ce42e93a35c93339e9c619f | [
"BSD-3-Clause"
] | null | null | null | coolplots/data.py | dylancromer/coolplots | 58ddfed2090af14d0ce42e93a35c93339e9c619f | [
"BSD-3-Clause"
] | null | null | null | coolplots/data.py | dylancromer/coolplots | 58ddfed2090af14d0ce42e93a35c93339e9c619f | [
"BSD-3-Clause"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def plot1d(xdata, ydata, outfile=None, xdata_label=None, ydata_label=None, caption=None):
plt.gcf().clear()
with plt.xkcd():
fig = plt.figure()
ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))
ax.spines['right'].set_color('none')
ax.spi... | 28.655738 | 121 | 0.592105 | import matplotlib.pyplot as plt
import numpy as np
def plot1d(xdata, ydata, outfile=None, xdata_label=None, ydata_label=None, caption=None):
plt.gcf().clear()
with plt.xkcd():
fig = plt.figure()
ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))
ax.spines['right'].set_color('none')
ax.spi... | true | true |
1c172de183617699dc30ad6cd4bbd1cdcb5806b2 | 2,677 | py | Python | src/ai_driver.py | serge-m/omicron_ai_pilot_keras | c9f0459ecd880ff685ba852eccd24685ab73623e | [
"MIT"
] | null | null | null | src/ai_driver.py | serge-m/omicron_ai_pilot_keras | c9f0459ecd880ff685ba852eccd24685ab73623e | [
"MIT"
] | null | null | null | src/ai_driver.py | serge-m/omicron_ai_pilot_keras | c9f0459ecd880ff685ba852eccd24685ab73623e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import threading
import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from sensor_msgs.msg import CompressedImage
import tensorflow as tf
from tensorflow.python.keras.models import load_model
from keras_preprocessing.image.utils import load_img, img_to_array
from io import BytesIO... | 30.420455 | 91 | 0.657452 | import threading
import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from sensor_msgs.msg import CompressedImage
import tensorflow as tf
from tensorflow.python.keras.models import load_model
from keras_preprocessing.image.utils import load_img, img_to_array
from io import BytesIO
import numpy as np
imp... | true | true |
1c172e7016d3f2c5b02c37f13c145fc7a582d506 | 1,061 | py | Python | src/fractal/world/fractum/placement/pulse/discrete.py | jedhsu/fractal | 97833ddc5063fae72352cf590738fef508c02f0c | [
"MIT"
] | null | null | null | src/fractal/world/fractum/placement/pulse/discrete.py | jedhsu/fractal | 97833ddc5063fae72352cf590738fef508c02f0c | [
"MIT"
] | null | null | null | src/fractal/world/fractum/placement/pulse/discrete.py | jedhsu/fractal | 97833ddc5063fae72352cf590738fef508c02f0c | [
"MIT"
] | null | null | null | """
*Coarsely*
Type for step function schedules.
# Constructor
StepSchedule(;start, change_at, values)
Return a schedule that has initial value `start`. For all `i`, the schedule
takes value `values[i]` at step `change_at[i]`.
"""
class Coarsely(Flow):
start: R
xs: Vector[Int]
ys: Vector{R}
en... | 23.065217 | 75 | 0.66541 | """
*Coarsely*
Type for step function schedules.
# Constructor
StepSchedule(;start, change_at, values)
Return a schedule that has initial value `start`. For all `i`, the schedule
takes value `values[i]` at step `change_at[i]`.
"""
class Coarsely(Flow):
start: R
xs: Vector[Int]
ys: Vector{R}
en... | false | true |
1c172ecb19d5b6a4159e4df16767b43114439dfd | 235 | py | Python | day01/hello.py | zhangyage/Python-oldboy | a95c1b465929e2be641e425fcb5e15b366800831 | [
"Apache-2.0"
] | 1 | 2020-06-04T08:44:09.000Z | 2020-06-04T08:44:09.000Z | day01/hello.py | zhangyage/Python-oldboy | a95c1b465929e2be641e425fcb5e15b366800831 | [
"Apache-2.0"
] | null | null | null | day01/hello.py | zhangyage/Python-oldboy | a95c1b465929e2be641e425fcb5e15b366800831 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
print 'Hello World!'
#version 3.0
print ('Hello World!')
x = 5
b = x
c = 5
print id(x)
print id(b)
print id(c)
#type是判断对应的变量的类型
zhang = 'this is a test'
print type(c)
print type(zhang) | 11.75 | 24 | 0.634043 |
print 'Hello World!'
print ('Hello World!')
x = 5
b = x
c = 5
print id(x)
print id(b)
print id(c)
zhang = 'this is a test'
print type(c)
print type(zhang) | false | true |
1c172f3cb67193ca07460c9cc675f47a212e660b | 1,571 | py | Python | backend/moni/urls.py | hibare/Moni | 83f63205c0b348d3c1bc05208122779b8fe1d117 | [
"MIT"
] | 1 | 2020-06-02T09:53:01.000Z | 2020-06-02T09:53:01.000Z | backend/moni/urls.py | hibare/Moni | 83f63205c0b348d3c1bc05208122779b8fe1d117 | [
"MIT"
] | 78 | 2021-05-18T11:29:33.000Z | 2022-03-28T05:21:45.000Z | backend/moni/urls.py | hibare/Moni | 83f63205c0b348d3c1bc05208122779b8fe1d117 | [
"MIT"
] | 2 | 2019-12-13T04:51:12.000Z | 2021-03-26T18:40:40.000Z | """moni URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 41.342105 | 92 | 0.694462 | from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView
from django.views.generic.base import RedirectView
from .views import index_v, health_v, version_v, OpenAPISchemaView, ReDocView, SwaggerUIView
urlpatterns = [
path('', index_v, name='index'),
p... | true | true |
1c17307bfb8772c95dd5cfe2108a67acba793a6b | 5,176 | py | Python | models_targeted_attacks/target_mng/attack_target_mng.py | huschen/kaggle_nips17_adversarial | aa619d937a77ef5f2efee6475b573aea652cf3cf | [
"MIT"
] | 4 | 2017-10-07T06:52:35.000Z | 2019-04-29T20:15:12.000Z | models_targeted_attacks/target_mng/attack_target_mng.py | huschen/kaggle_nips17_adversarial | aa619d937a77ef5f2efee6475b573aea652cf3cf | [
"MIT"
] | 1 | 2017-10-21T20:01:40.000Z | 2017-11-19T23:49:20.000Z | models_targeted_attacks/target_mng/attack_target_mng.py | huschen/kaggle_nips17_adversarial | aa619d937a77ef5f2efee6475b573aea652cf3cf | [
"MIT"
] | null | null | null | """Implementation of target attack.
Three models (base_incep, adv_incep, res_incep) are used.
The models are ensembled using mean norm gradient methrod.
The inferstructure code is based on
https://github.com/tensorflow/cleverhans/cleverhans/tree/master/
examples/nips17_adversarial_competition/sample_targeted_... | 38.626866 | 83 | 0.661321 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import tensorflow as tf
from tensorflow.contrib import slim
from lib_adv import utils, attack
tf.flags.DEFINE_string(
'output_dir',
'../../intermediate_results/target... | true | true |
1c17311a7795f87a23a394174f2894c7e49ee566 | 5,032 | py | Python | server.py | carolinedunn/unicorn-busy-server | 1e546331af38f0672fc03400251db12709f2b8b5 | [
"MIT"
] | 12 | 2020-06-19T13:43:18.000Z | 2022-02-01T13:23:03.000Z | server.py | carolinedunn/unicorn-busy-server | 1e546331af38f0672fc03400251db12709f2b8b5 | [
"MIT"
] | null | null | null | server.py | carolinedunn/unicorn-busy-server | 1e546331af38f0672fc03400251db12709f2b8b5 | [
"MIT"
] | 4 | 2020-07-01T11:52:30.000Z | 2022-03-01T13:22:54.000Z | #!/usr/bin/env python
import json
import unicornhat as unicorn
import threading
from time import sleep
from datetime import datetime
from gpiozero import CPUTemperature
from flask import Flask, jsonify, make_response, request
from random import randint
blinkThread = None
globalRed = 0
globalGreen = 0
globalBlue = 0
... | 23.18894 | 177 | 0.707075 |
import json
import unicornhat as unicorn
import threading
from time import sleep
from datetime import datetime
from gpiozero import CPUTemperature
from flask import Flask, jsonify, make_response, request
from random import randint
blinkThread = None
globalRed = 0
globalGreen = 0
globalBlue = 0
globalLastCalled = Non... | true | true |
1c1732b4184aa5b04ce5663d6452fdbb2c956e64 | 2,629 | py | Python | nsis/python/cli/xraylib-cli.py | golosio/xraylib | dc722b183ff8168f632ab7b64df8e894c0235d42 | [
"BSD-3-Clause"
] | 1 | 2016-02-28T19:01:40.000Z | 2016-02-28T19:01:40.000Z | nsis/python/cli/xraylib-cli.py | golosio/xraylib | dc722b183ff8168f632ab7b64df8e894c0235d42 | [
"BSD-3-Clause"
] | null | null | null | nsis/python/cli/xraylib-cli.py | golosio/xraylib | dc722b183ff8168f632ab7b64df8e894c0235d42 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#Copyright (c) 2009, Bruno Golosio, Antonio Brunetti, Manuel Sanchez del Rio, Tom Schoonjans and Teemu Ikonen
#All rights reserved.
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
# * Redistributi... | 43.098361 | 860 | 0.740966 |
from __future__ import print_function
from math import *
from xraylib import *
import getopt, sys, string, traceback
from xraymessages import *
from xrayhelp import *
from pprint import pprint
if __name__ == '__main__' :
if len(sys.argv) == 1:
display_banner()
display_usage()
sys.exit(0)
short = 'hdf:... | true | true |
1c1732cde794f51dccaf0813ba245341a9f2bae5 | 185 | py | Python | openml/extensions/sklearn/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | openml/extensions/sklearn/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | openml/extensions/sklearn/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | # License: BSD 3-Clause
from .extension import SklearnExtension
from openml.extensions import register_extension
__all__ = ['SklearnExtension']
register_extension(SklearnExtension)
| 18.5 | 48 | 0.827027 |
from .extension import SklearnExtension
from openml.extensions import register_extension
__all__ = ['SklearnExtension']
register_extension(SklearnExtension)
| true | true |
1c1734c106b3773b052648983f0018d478ae3083 | 58,378 | py | Python | httpui.py | ArnavM1499/Hanabi-HumanAI | c2c159c28c784950a2c98cbd8bf81bfc9036484d | [
"BSD-3-Clause"
] | null | null | null | httpui.py | ArnavM1499/Hanabi-HumanAI | c2c159c28c784950a2c98cbd8bf81bfc9036484d | [
"BSD-3-Clause"
] | null | null | null | httpui.py | ArnavM1499/Hanabi-HumanAI | c2c159c28c784950a2c98cbd8bf81bfc9036484d | [
"BSD-3-Clause"
] | null | null | null | import http.server
import socketserver
import threading
import time
import shutil
import os
import hanabi
import Agents
import random
import hashlib
import tutorial
import sys
import traceback
import consent
import threading
from cgi import parse_header, parse_multipart
from urllib.parse import parse_qs
from serverconf... | 35.748928 | 348 | 0.478759 | import http.server
import socketserver
import threading
import time
import shutil
import os
import hanabi
import Agents
import random
import hashlib
import tutorial
import sys
import traceback
import consent
import threading
from cgi import parse_header, parse_multipart
from urllib.parse import parse_qs
from serverconf... | true | true |
1c1734c4d4ad7b4cf1c2cec9d5989b03ace4b1d8 | 2,835 | py | Python | termicoder/judges/iarcs/modules/utils/scrape.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | 1 | 2018-06-22T06:59:24.000Z | 2018-06-22T06:59:24.000Z | termicoder/judges/iarcs/modules/utils/scrape.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | null | null | null | termicoder/judges/iarcs/modules/utils/scrape.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
import sys
import termicoder.judges.iarcs.modules.utils.session as session
import termicoder.utils.display as display
def get_problem_list():
iarcs_session = session.iarcs_session
logged_in = (session.is_logged_in())
url = "http://opc.iarcs.org.in/index.php/pr... | 35 | 78 | 0.622575 | import requests
from bs4 import BeautifulSoup
import sys
import termicoder.judges.iarcs.modules.utils.session as session
import termicoder.utils.display as display
def get_problem_list():
iarcs_session = session.iarcs_session
logged_in = (session.is_logged_in())
url = "http://opc.iarcs.org.in/index.php/pr... | true | true |
1c1735d7d76028e356714bbb30f2c862128f9913 | 2,331 | py | Python | src/libs/blueprint/python/py_src/mesh/__init__.py | kant/conduit | 420c69805942a77c10fa29f773f101eb61793f04 | [
"BSD-3-Clause"
] | null | null | null | src/libs/blueprint/python/py_src/mesh/__init__.py | kant/conduit | 420c69805942a77c10fa29f773f101eb61793f04 | [
"BSD-3-Clause"
] | null | null | null | src/libs/blueprint/python/py_src/mesh/__init__.py | kant/conduit | 420c69805942a77c10fa29f773f101eb61793f04 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC.
#
# Produced at the Lawrence Livermore National Laboratory
#
# LLNL-CODE-666778
#
# All rights reserved.
#
# This file is part of Conduit.
#
# For details, see: htt... | 41.625 | 79 | 0.66109 |
from .conduit_blueprint_mesh_python import *
from . import examples
| true | true |
1c17377a0b9add329de281257a9d841ed83066db | 507 | py | Python | pipeline/stmt/generate-topic-index.py | riyachanduka/termite | 62cfb58d29354915db2c3f9c726e2ef2a976d4c0 | [
"BSD-3-Clause"
] | 73 | 2015-01-31T22:03:20.000Z | 2022-03-15T11:39:00.000Z | pipeline/stmt/generate-topic-index.py | riyachanduka/termite | 62cfb58d29354915db2c3f9c726e2ef2a976d4c0 | [
"BSD-3-Clause"
] | 3 | 2016-04-24T20:01:14.000Z | 2017-05-18T15:55:28.000Z | pipeline/stmt/generate-topic-index.py | riyachanduka/termite | 62cfb58d29354915db2c3f9c726e2ef2a976d4c0 | [
"BSD-3-Clause"
] | 27 | 2015-01-13T06:31:04.000Z | 2020-05-14T09:27:00.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
parser = argparse.ArgumentParser( description = 'Generate topic-index.txt' )
parser.add_argument( 'path', type = str, help = 'Path of STMT model output' )
parser.add_argument( 'topicCount', type = int, help = 'Number of topics' )
args = parser.parse_args()... | 28.166667 | 77 | 0.670611 |
import argparse
parser = argparse.ArgumentParser( description = 'Generate topic-index.txt' )
parser.add_argument( 'path', type = str, help = 'Path of STMT model output' )
parser.add_argument( 'topicCount', type = int, help = 'Number of topics' )
args = parser.parse_args()
path = args.path
topicCount = args.topicCount... | true | true |
1c17379cde89311f4e9543e5fcc2d51f295a50b4 | 18,871 | py | Python | chemprop/args.py | KEHANG/chemprop | 98e7da830e766311a70318bd8393cbc24cc5e9fd | [
"MIT"
] | null | null | null | chemprop/args.py | KEHANG/chemprop | 98e7da830e766311a70318bd8393cbc24cc5e9fd | [
"MIT"
] | null | null | null | chemprop/args.py | KEHANG/chemprop | 98e7da830e766311a70318bd8393cbc24cc5e9fd | [
"MIT"
] | null | null | null | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
from tap import Tap # pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)
from chemprop.features import get_avail... | 47.774684 | 225 | 0.690795 | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
from tap import Tap
from chemprop.features import get_available_features_generators
def get_checkpoint_paths(checkpoint_dir: Optional[str],
... | true | true |
1c1737be551384320a67eaf5e29921537117d64b | 2,168 | py | Python | 2018/day9/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2018/day9/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2018/day9/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | import argparse
import collections
import datetime
import itertools
import logging
import re
import sys
# Wrong: 3278129354 (too high)
# Right: 3277920293
def parse_args(args):
parser = argparse.ArgumentParser()
parser.add_argument("input", type=argparse.FileType('r'),
metavar="PUZZLE... | 27.794872 | 77 | 0.620849 | import argparse
import collections
import datetime
import itertools
import logging
import re
import sys
def parse_args(args):
parser = argparse.ArgumentParser()
parser.add_argument("input", type=argparse.FileType('r'),
metavar="PUZZLE_INPUT")
parser.add_argument('-d', '--debug', a... | true | true |
1c17386f1b68a8613dab07c184a4ad4125be9064 | 518 | py | Python | Python/project-euler/problems/problem_020.py | davydehaas98/project-euler | b9ea07a74bd941f026f6c0618a86a9dad096c9cb | [
"MIT"
] | 4 | 2020-11-22T18:39:08.000Z | 2020-11-24T13:05:38.000Z | Python/project-euler/problems/problem_020.py | davydehaas98/project-euler | b9ea07a74bd941f026f6c0618a86a9dad096c9cb | [
"MIT"
] | null | null | null | Python/project-euler/problems/problem_020.py | davydehaas98/project-euler | b9ea07a74bd941f026f6c0618a86a9dad096c9cb | [
"MIT"
] | null | null | null | from utils.code_runner import execute_code
def problem():
n = 100
factorial = 1
total_sum = 0
# n! means n × (n − 1) × ... × 3 × 2 × 1
# Get the product of all positive integers less than or equal to n
for current_factorial in range(n, 0, -1):
factorial *= current_factorial
# Put t... | 24.666667 | 70 | 0.631274 | from utils.code_runner import execute_code
def problem():
n = 100
factorial = 1
total_sum = 0
for current_factorial in range(n, 0, -1):
factorial *= current_factorial
for digit in [int(x) for x in str(factorial)]:
total_sum += digit
return total_sum
if __name__ =... | true | true |
1c1738ab0ebeb0c9792ae538a53360f9c51158f3 | 1,051 | py | Python | tensorflow_datasets/text/ag_news_subset_test.py | ChAnYaNG97/datasets | 0a45e2ea98716d325fc1c5e5494f2575f3bdb908 | [
"Apache-2.0"
] | 1 | 2020-10-11T19:15:49.000Z | 2020-10-11T19:15:49.000Z | tensorflow_datasets/text/ag_news_subset_test.py | ChAnYaNG97/datasets | 0a45e2ea98716d325fc1c5e5494f2575f3bdb908 | [
"Apache-2.0"
] | 1 | 2021-02-23T20:16:05.000Z | 2021-02-23T20:16:05.000Z | tensorflow_datasets/text/ag_news_subset_test.py | ChAnYaNG97/datasets | 0a45e2ea98716d325fc1c5e5494f2575f3bdb908 | [
"Apache-2.0"
] | 1 | 2020-08-03T20:19:12.000Z | 2020-08-03T20:19:12.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | 31.848485 | 74 | 0.748811 |
from tensorflow_datasets import testing
from tensorflow_datasets.text import ag_news_subset
class AgNewsSubsetTest(testing.DatasetBuilderTestCase):
DATASET_CLASS = ag_news_subset.AGNewsSubset
SPLITS = {
"train": 3, "test": 2, }
DL_EXTRACT_RESULT = {"ag_news_csv": ""}
if __name__ == "__main__... | true | true |
1c1738ef04081080bc5cc3168d57d109f4fa4fba | 29 | py | Python | app/src/db/folder_manager/__init__.py | kennethgoodman/no-sql-lite | f53f59ae2f1e69f4b212cdd399537a313cc52a3a | [
"MIT"
] | 13 | 2020-09-02T09:05:08.000Z | 2022-03-12T02:43:24.000Z | app/src/db/folder_manager/__init__.py | kennethgoodman/no-sql-lite | f53f59ae2f1e69f4b212cdd399537a313cc52a3a | [
"MIT"
] | 1,998 | 2020-06-15T11:46:10.000Z | 2022-03-24T22:12:41.000Z | app/src/db/folder_manager/__init__.py | kennethgoodman/no-sql-lite | f53f59ae2f1e69f4b212cdd399537a313cc52a3a | [
"MIT"
] | 8 | 2020-09-29T06:50:35.000Z | 2021-06-14T03:30:52.000Z | from .manager import Manager
| 14.5 | 28 | 0.827586 | from .manager import Manager
| true | true |
1c173900d5de93d5c7524f4a03be5a7642e4aa10 | 15,263 | py | Python | pyogg/opus_buffered_encoder.py | iojon/PyOgg | b03f4a7f3a4e677ab2d4fb9a413be32eb16f0b2d | [
"BSD-3-Clause",
"Unlicense"
] | null | null | null | pyogg/opus_buffered_encoder.py | iojon/PyOgg | b03f4a7f3a4e677ab2d4fb9a413be32eb16f0b2d | [
"BSD-3-Clause",
"Unlicense"
] | null | null | null | pyogg/opus_buffered_encoder.py | iojon/PyOgg | b03f4a7f3a4e677ab2d4fb9a413be32eb16f0b2d | [
"BSD-3-Clause",
"Unlicense"
] | null | null | null | import copy
import ctypes
from typing import Optional, ByteString, List, Tuple, Callable
import warnings
from . import opus
from .opus_encoder import OpusEncoder
from .pyogg_error import PyOggError
class OpusBufferedEncoder(OpusEncoder):
# TODO: This could be made more efficient. We don't need a
# deque. In... | 37.68642 | 81 | 0.531678 | import copy
import ctypes
from typing import Optional, ByteString, List, Tuple, Callable
import warnings
from . import opus
from .opus_encoder import OpusEncoder
from .pyogg_error import PyOggError
class OpusBufferedEncoder(OpusEncoder):
# deque. Instead, we need only sufficient PCM storage for one
# who... | true | true |
1c17390bb4e1fdf0b08b1ce1bf11c1f2b73aa110 | 2,075 | py | Python | proj_temp/step_04.02_batch_check_rigid_registration_site005.py | devhliu/dlaais-data | 790c497ab8e1c39524d37f924a72ea52343a01a8 | [
"MIT"
] | null | null | null | proj_temp/step_04.02_batch_check_rigid_registration_site005.py | devhliu/dlaais-data | 790c497ab8e1c39524d37f924a72ea52343a01a8 | [
"MIT"
] | null | null | null | proj_temp/step_04.02_batch_check_rigid_registration_site005.py | devhliu/dlaais-data | 790c497ab8e1c39524d37f924a72ea52343a01a8 | [
"MIT"
] | null | null | null |
import os
import ants
import shutil
import nibabel as nib
import numpy as np
import pandas as pd
from glob import glob
working_root = '/data/public/data/003_STROKE_CTP/002_NIIX_SITE005'
clinical_root = '/data/public/data/003_STROKE_CTP/003_CLINICAL_SITE005'
output_xlsx_filename = '002_NIIX_SITE005_CTP_mean_mc_mni'
... | 42.346939 | 105 | 0.584096 |
import os
import ants
import shutil
import nibabel as nib
import numpy as np
import pandas as pd
from glob import glob
working_root = '/data/public/data/003_STROKE_CTP/002_NIIX_SITE005'
clinical_root = '/data/public/data/003_STROKE_CTP/003_CLINICAL_SITE005'
output_xlsx_filename = '002_NIIX_SITE005_CTP_mean_mc_mni'
... | true | true |
1c17390e83257c31918457d263fe6146f125d2b7 | 619 | py | Python | tests/test_sources.py | DuncanArani/mynews | bad77c1cc49e4ffd886dd4f98b1218afc31c902f | [
"MIT"
] | null | null | null | tests/test_sources.py | DuncanArani/mynews | bad77c1cc49e4ffd886dd4f98b1218afc31c902f | [
"MIT"
] | null | null | null | tests/test_sources.py | DuncanArani/mynews | bad77c1cc49e4ffd886dd4f98b1218afc31c902f | [
"MIT"
] | null | null | null | import unittest
from app.models import Sources
class SourcesTest(unittest.TestCase):
'''
Test Class to test the behaviour of the Movie class
'''
def setUp(self):
'''
Set up method that will run before every Test
'''
self.new_source = Sources(
'abc-news', 'A... | 26.913043 | 183 | 0.654281 | import unittest
from app.models import Sources
class SourcesTest(unittest.TestCase):
def setUp(self):
self.new_source = Sources(
'abc-news', 'ABC News', 'Your trusted source for breaking news analysis exclusive interviews, headlines, and videos at ABCNews.com.', ' "http://abcnews.go.com', 'ge... | true | true |
1c1739148c405dc7393ef5bde93a5d8502465a12 | 6,092 | py | Python | code/raspberrypi/robot.py | Ecam-Eurobot/Eurobot-2017 | 910dcb77d1af532fd1c1d771b72bd6c88b2c4fa6 | [
"MIT"
] | 1 | 2022-02-17T23:05:12.000Z | 2022-02-17T23:05:12.000Z | code/raspberrypi/robot.py | Ecam-Eurobot/Eurobot-2017 | 910dcb77d1af532fd1c1d771b72bd6c88b2c4fa6 | [
"MIT"
] | null | null | null | code/raspberrypi/robot.py | Ecam-Eurobot/Eurobot-2017 | 910dcb77d1af532fd1c1d771b72bd6c88b2c4fa6 | [
"MIT"
] | null | null | null | import logging
import math
import time
from graphmap.map_generator import build_graph
from kinematics import Kinematics
from motors import Motors
from range_sensors import RangeSensor
class Robot:
_DELAY_OPEN_ClOSE_CLAMP = 0.7
_DELAY_UP_DOWN_CLAMP = 2.5
_DELAY_IN_OUT_BLOCK = 3
# US sensors constant... | 35.213873 | 92 | 0.569599 | import logging
import math
import time
from graphmap.map_generator import build_graph
from kinematics import Kinematics
from motors import Motors
from range_sensors import RangeSensor
class Robot:
_DELAY_OPEN_ClOSE_CLAMP = 0.7
_DELAY_UP_DOWN_CLAMP = 2.5
_DELAY_IN_OUT_BLOCK = 3
US_SENSORS = [
... | true | true |
1c1739930999b1899773526fe5504091b9d54706 | 17,103 | py | Python | flexget/tests/test_subtitle_list.py | fotile96/Flexget | 0f7f805a43e25e27fce195b91228f911bf4c6b1e | [
"MIT"
] | 1 | 2021-03-16T18:41:47.000Z | 2021-03-16T18:41:47.000Z | flexget/tests/test_subtitle_list.py | fotile96/Flexget | 0f7f805a43e25e27fce195b91228f911bf4c6b1e | [
"MIT"
] | null | null | null | flexget/tests/test_subtitle_list.py | fotile96/Flexget | 0f7f805a43e25e27fce195b91228f911bf4c6b1e | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import datetime
import os
import sys
import pytest
from flexget.manager import Session
from flexget.plugins.list.subtitle_list import SubtitleListFile, SubtitleListLangua... | 38.091314 | 120 | 0.595393 | from __future__ import unicode_literals, division, absolute_import
from builtins import *
import datetime
import os
import sys
import pytest
from flexget.manager import Session
from flexget.plugins.list.subtitle_list import SubtitleListFile, SubtitleListLanguage, normalize_path
try:
import subliminal
except Im... | true | true |
1c1739f1d8d8b97cad5f8e3a94f8e23303a7cab2 | 479 | py | Python | src/pretrained.py | dotimothy/EECS195-Colorization | 9ebd63c6d7a36c44ea65f981f9dad98dbe91e754 | [
"MIT"
] | 2 | 2022-03-25T21:18:15.000Z | 2022-03-28T23:39:20.000Z | src/pretrained.py | dotimothy/EECS195-Colorization | 9ebd63c6d7a36c44ea65f981f9dad98dbe91e754 | [
"MIT"
] | null | null | null | src/pretrained.py | dotimothy/EECS195-Colorization | 9ebd63c6d7a36c44ea65f981f9dad98dbe91e754 | [
"MIT"
] | null | null | null | from pyexpat import model
from re import S
import tensorflow as tf
from tensorflow import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Conv2D, UpSampling2D, InputLayer, Conv2DTranspose, Input, Reshape, merge, concatenate
from keras.models import Sequential, Model, load_model
i... | 31.933333 | 110 | 0.830898 | from pyexpat import model
from re import S
import tensorflow as tf
from tensorflow import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Conv2D, UpSampling2D, InputLayer, Conv2DTranspose, Input, Reshape, merge, concatenate
from keras.models import Sequential, Model, load_model
i... | true | true |
1c173a0034c01d8575917e6f1ad58e840a1bda0f | 1,706 | py | Python | pretorched/layers/attention.py | schwettmann/pretorched-x | ce8c3712434b3cd5d85dcbe8582ff51ddfa7d4ed | [
"MIT"
] | 16 | 2019-05-31T06:09:36.000Z | 2021-03-04T12:00:34.000Z | pretorched/layers/attention.py | schwettmann/pretorched-x | ce8c3712434b3cd5d85dcbe8582ff51ddfa7d4ed | [
"MIT"
] | 3 | 2022-02-27T06:43:34.000Z | 2022-03-18T08:30:30.000Z | pretorched/layers/attention.py | schwettmann/pretorched-x | ce8c3712434b3cd5d85dcbe8582ff51ddfa7d4ed | [
"MIT"
] | 3 | 2019-05-31T13:07:23.000Z | 2020-07-22T18:58:47.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter as P
class Attention(nn.Module):
"""A non-local block as used in SA-GAN.
NOTE: The implementation as described in the paper is largely incorrect!
Below, we provide a one-to-one PyTorch porting of the officia... | 38.772727 | 101 | 0.607268 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter as P
class Attention(nn.Module):
def __init__(self, ch, conv_func=nn.Conv2d):
super().__init__()
self.ch = ch
self.conv_func = conv_func
self.theta = self.conv_func(self.ch, s... | true | true |
1c173a146beb9578d76f557f7a44f9a6c766a6ad | 192,644 | py | Python | autotest/gdrivers/nitf.py | FeU-aKlos/gdal | bba6781133815248c9329842d365f8812b74c33f | [
"Apache-2.0"
] | 2 | 2022-03-24T00:53:48.000Z | 2022-03-26T02:52:52.000Z | autotest/gdrivers/nitf.py | FeU-aKlos/gdal | bba6781133815248c9329842d365f8812b74c33f | [
"Apache-2.0"
] | null | null | null | autotest/gdrivers/nitf.py | FeU-aKlos/gdal | bba6781133815248c9329842d365f8812b74c33f | [
"Apache-2.0"
] | 1 | 2022-01-13T19:15:30.000Z | 2022-01-13T19:15:30.000Z | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read/write functionality for NITF driver.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
##########################################... | 38.086991 | 1,079 | 0.592928 |
import copy
import os
import array
import struct
import shutil
import base64
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
import gdaltest
import pytest
@pytest.fixture(scope='module')
def not_jpeg_9b():
import jpeg
jpeg.test_jpeg_1()
if gdaltest.jpeg_version == '9b':
pytest... | true | true |
1c173aa13332255bea1eac9ce0727473139d967d | 12,121 | py | Python | lib/galaxy/tools/deps/__init__.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/deps/__init__.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/deps/__init__.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | null | null | null | """
Dependency management for tools.
"""
import json
import logging
import os.path
import shutil
from collections import OrderedDict
from galaxy.util import (
hash_util,
plugin_config
)
from galaxy.util.oset import OrderedSet
from .requirements import (
ToolRequirement,
ToolRequirements
)
from .reso... | 43.600719 | 134 | 0.69029 |
import json
import logging
import os.path
import shutil
from collections import OrderedDict
from galaxy.util import (
hash_util,
plugin_config
)
from galaxy.util.oset import OrderedSet
from .requirements import (
ToolRequirement,
ToolRequirements
)
from .resolvers import NullDependency
from .resolve... | true | true |
1c173b2bc3c0a54c9e15c467846ef47eaffb01ca | 298 | py | Python | panel/models/state.py | datalayer-contrib/holoviz-panel | c97b57e8eaff4b5f542add41f496395da2483b23 | [
"BSD-3-Clause"
] | 1,130 | 2019-11-23T09:53:37.000Z | 2022-03-31T11:30:07.000Z | panel/models/state.py | datalayer-contrib/holoviz-panel | c97b57e8eaff4b5f542add41f496395da2483b23 | [
"BSD-3-Clause"
] | 2,265 | 2019-11-20T17:09:09.000Z | 2022-03-31T22:09:38.000Z | panel/models/state.py | datalayer-contrib/holoviz-panel | c97b57e8eaff4b5f542add41f496395da2483b23 | [
"BSD-3-Clause"
] | 215 | 2019-11-26T11:49:04.000Z | 2022-03-30T10:23:11.000Z | from bokeh.core.properties import Bool, Dict, Any, List
from bokeh.models import Model
class State(Model):
json = Bool(False, help="Whether the values point to json files")
state = Dict(Any, Any, help="Contains the recorded state")
widgets = Dict(Any, Any)
values = List(Any)
| 21.285714 | 69 | 0.694631 | from bokeh.core.properties import Bool, Dict, Any, List
from bokeh.models import Model
class State(Model):
json = Bool(False, help="Whether the values point to json files")
state = Dict(Any, Any, help="Contains the recorded state")
widgets = Dict(Any, Any)
values = List(Any)
| true | true |
1c173bbeaeb10fbead471dd3657cb7899aa86576 | 1,859 | py | Python | update_accounts.py | draem0507/rietveld | 70bda77edf3a642ef51ecc2d73c165345af5fdee | [
"Apache-2.0"
] | 583 | 2015-03-28T23:49:34.000Z | 2022-03-25T10:58:07.000Z | update_accounts.py | draem0507/rietveld | 70bda77edf3a642ef51ecc2d73c165345af5fdee | [
"Apache-2.0"
] | 61 | 2015-04-02T01:08:34.000Z | 2021-05-27T16:19:35.000Z | update_accounts.py | draem0507/rietveld | 70bda77edf3a642ef51ecc2d73c165345af5fdee | [
"Apache-2.0"
] | 175 | 2015-03-29T13:06:36.000Z | 2022-03-31T07:02:20.000Z | # Removes duplicate nicknames (issue99).
#
# To run this script:
# - Make sure App Engine library (incl. yaml) is in PYTHONPATH.
# - Make sure that the remote API is included in app.yaml.
# - Run "tools/appengine_console.py APP_ID".
# - Import this module.
# - update_accounts.run() updates accounts.
# - Use the o... | 29.507937 | 69 | 0.622916 |
from google.appengine.ext import ndb
from codereview import models
def fetch_accounts():
query = models.Account.query()
accounts = {}
results = query.fetch(100)
while results:
last = None
for account in results:
if account.lower_nickname in accounts:
acco... | false | true |
1c173d0db013e658afc585481879e29c9a23eee5 | 1,733 | py | Python | app/__init__.py | cyberinnovationhub/lunch-roulette | 0b0b933188c095b6e3778ee7de9d4e21cd7caae5 | [
"BSD-3-Clause"
] | 4 | 2020-12-03T19:24:20.000Z | 2022-03-16T13:45:11.000Z | app/__init__.py | cyberinnovationhub/lunch-roulette | 0b0b933188c095b6e3778ee7de9d4e21cd7caae5 | [
"BSD-3-Clause"
] | 3 | 2020-08-24T08:05:11.000Z | 2021-11-07T06:14:36.000Z | app/__init__.py | cyberinnovationhub/lunch-roulette | 0b0b933188c095b6e3778ee7de9d4e21cd7caae5 | [
"BSD-3-Clause"
] | 3 | 2020-08-27T13:58:53.000Z | 2022-03-09T14:09:06.000Z | from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from config import Config
from redis import Redis
from datetime import timedelta
import rq
app = Flask(__... | 32.698113 | 99 | 0.730525 | from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from config import Config
from redis import Redis
from datetime import timedelta
import rq
app = Flask(__... | true | true |
1c173e526dc2fdfae4bdddc3e271fe1e50dacc3b | 6,569 | py | Python | tests/model_fields/test_uuid.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-21T02:20:06.000Z | 2020-10-21T02:20:06.000Z | tests/model_fields/test_uuid.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-02T21:10:44.000Z | 2020-07-02T21:11:21.000Z | tests/model_fields/test_uuid.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-08-11T18:46:32.000Z | 2020-08-11T18:46:32.000Z | import json
import uuid
from django.core import exceptions, serializers
from django.db import IntegrityError, models
from django.test import (
SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature,
)
from .models import (
NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,... | 37.537143 | 103 | 0.698128 | import json
import uuid
from django.core import exceptions, serializers
from django.db import IntegrityError, models
from django.test import (
SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature,
)
from .models import (
NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,... | true | true |
1c173e7cdce079d2b3aa038c0bde05f79904cb96 | 2,200 | py | Python | murano/packages/mpl_package.py | ISCAS-VDI/murano-base | 34287bd9109b32a2bb0960c0428fe402dee6d9b2 | [
"Apache-2.0"
] | 1 | 2021-07-28T23:19:49.000Z | 2021-07-28T23:19:49.000Z | murano/packages/mpl_package.py | ISCAS-VDI/murano-base | 34287bd9109b32a2bb0960c0428fe402dee6d9b2 | [
"Apache-2.0"
] | null | null | null | murano/packages/mpl_package.py | ISCAS-VDI/murano-base | 34287bd9109b32a2bb0960c0428fe402dee6d9b2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 35.483871 | 78 | 0.662273 |
import os
from murano.packages import exceptions
from murano.packages import package_base
class MuranoPlPackage(package_base.PackageBase):
def __init__(self, format_name, runtime_version, source_directory,
manifest):
super(MuranoPlPackage, self).__init__(
format_name, runtim... | true | true |
1c173faae3f6b2a61d981d5d9a3c2640a496607a | 4,447 | py | Python | deepchem/molnet/load_function/hiv_datasets.py | akihironitta/deepchem | ffad1a75997bb79360751b2a5fcf3b3405f3c44e | [
"MIT"
] | null | null | null | deepchem/molnet/load_function/hiv_datasets.py | akihironitta/deepchem | ffad1a75997bb79360751b2a5fcf3b3405f3c44e | [
"MIT"
] | null | null | null | deepchem/molnet/load_function/hiv_datasets.py | akihironitta/deepchem | ffad1a75997bb79360751b2a5fcf3b3405f3c44e | [
"MIT"
] | null | null | null | """
hiv dataset loader.
"""
import os
import logging
import deepchem
logger = logging.getLogger(__name__)
HIV_URL = 'http://deepchem.io.s3-website-us-west-1.amazonaws.com/datasets/HIV.csv'
DEFAULT_DIR = deepchem.utils.get_data_dir()
def load_hiv(featurizer='ECFP',
split='index',
reload=Tru... | 34.472868 | 107 | 0.704745 | import os
import logging
import deepchem
logger = logging.getLogger(__name__)
HIV_URL = 'http://deepchem.io.s3-website-us-west-1.amazonaws.com/datasets/HIV.csv'
DEFAULT_DIR = deepchem.utils.get_data_dir()
def load_hiv(featurizer='ECFP',
split='index',
reload=True,
data_dir=Non... | true | true |
1c173feaa5f65343ae67dcba969f534df1d717f1 | 1,201 | py | Python | pypesto/startpoint/__init__.py | yannikschaelte/pyPESTO | dca625328b3d1200b2d4dd18f7be97468b651aed | [
"BSD-3-Clause"
] | null | null | null | pypesto/startpoint/__init__.py | yannikschaelte/pyPESTO | dca625328b3d1200b2d4dd18f7be97468b651aed | [
"BSD-3-Clause"
] | null | null | null | pypesto/startpoint/__init__.py | yannikschaelte/pyPESTO | dca625328b3d1200b2d4dd18f7be97468b651aed | [
"BSD-3-Clause"
] | null | null | null | """
Startpoint
==========
Method for selecting points that can be used as start points
for multistart optimization. All methods have the form
``method(**kwargs) -> startpoints``
where the kwargs can/should include the following parameters, which are
passed by pypesto:
n_starts: int
Number of points to gener... | 28.595238 | 75 | 0.741049 |
from .uniform import uniform
from .latin_hypercube import latin_hypercube
from .util import assign_startpoints
__all__ = ['uniform',
'latin_hypercube',
'assign_startpoints']
| true | true |
1c1740610b326b15189692a252f32f8ddbe937ee | 3,771 | py | Python | nodes/centered_mocap_rebroadcaster.py | wtabib/extrinsics_calibrator | b0957e45e9c1c09e60ec115c1ec94991a0b338a0 | [
"BSD-3-Clause"
] | 3 | 2020-10-10T21:19:02.000Z | 2022-03-06T06:42:53.000Z | nodes/centered_mocap_rebroadcaster.py | wtabib/extrinsics_calibrator | b0957e45e9c1c09e60ec115c1ec94991a0b338a0 | [
"BSD-3-Clause"
] | null | null | null | nodes/centered_mocap_rebroadcaster.py | wtabib/extrinsics_calibrator | b0957e45e9c1c09e60ec115c1ec94991a0b338a0 | [
"BSD-3-Clause"
] | 1 | 2019-09-05T21:39:55.000Z | 2019-09-05T21:39:55.000Z | #!/usr/bin/env python2.7
from __future__ import division
import roslib
import rospy
import tf
from nav_msgs.msg import Odometry
from nav_msgs.msg import Path
from geometry_msgs.msg import PoseStamped
import numpy as np
class GT_cleaner:
def __init__(self):
self.last_time = rospy.Time.now()
self.... | 34.916667 | 97 | 0.622116 | from __future__ import division
import roslib
import rospy
import tf
from nav_msgs.msg import Odometry
from nav_msgs.msg import Path
from geometry_msgs.msg import PoseStamped
import numpy as np
class GT_cleaner:
def __init__(self):
self.last_time = rospy.Time.now()
self.init = False
self... | true | true |
1c17415a513661a52ddb074159a8de9499620f94 | 453 | py | Python | tests/test_executable.py | softbear/squidpy_notebooks | 28a5989105e705f06070fbe52b3dfb4d5741e3bd | [
"MIT"
] | null | null | null | tests/test_executable.py | softbear/squidpy_notebooks | 28a5989105e705f06070fbe52b3dfb4d5741e3bd | [
"MIT"
] | null | null | null | tests/test_executable.py | softbear/squidpy_notebooks | 28a5989105e705f06070fbe52b3dfb4d5741e3bd | [
"MIT"
] | null | null | null | from pathlib import Path
import runpy
import pytest
ROOT = Path(__file__).parent.parent
TUTORIALS = tuple(map(str, ((ROOT / "tutorials").resolve().glob("*.py"))))
EXAMPLES = tuple(map(str, ((ROOT / "examples").resolve().glob("*/*.py"))))
@pytest.mark.parametrize("tutorial", TUTORIALS)
def test_tutorials(tutorial):
... | 23.842105 | 74 | 0.717439 | from pathlib import Path
import runpy
import pytest
ROOT = Path(__file__).parent.parent
TUTORIALS = tuple(map(str, ((ROOT / "tutorials").resolve().glob("*.py"))))
EXAMPLES = tuple(map(str, ((ROOT / "examples").resolve().glob("*/*.py"))))
@pytest.mark.parametrize("tutorial", TUTORIALS)
def test_tutorials(tutorial):
... | true | true |
1c17417f1610cf2e2f5909fe234a10d62079b845 | 3,973 | py | Python | example/radius_acct_stop_client.py | fertiland/pyprotosim | b329c060f1cd521e264da8416249a02429f432f3 | [
"BSD-2-Clause"
] | 12 | 2017-11-07T12:45:43.000Z | 2022-02-10T12:36:49.000Z | example/radius_acct_stop_client.py | fertiland/pyprotosim | b329c060f1cd521e264da8416249a02429f432f3 | [
"BSD-2-Clause"
] | 1 | 2019-02-12T09:25:55.000Z | 2019-02-12T09:25:55.000Z | example/radius_acct_stop_client.py | fertiland/pyprotosim | b329c060f1cd521e264da8416249a02429f432f3 | [
"BSD-2-Clause"
] | 5 | 2018-09-19T09:46:50.000Z | 2020-08-20T09:46:53.000Z | #!/usr/bin/env python
##################################################################
# Copyright (c) 2012, Sergej Srepfler <sergej.srepfler@gmail.com>
# February 2012 - March 2014
# Version 0.2.9, Last change on Mar 06, 2014
# This software is distributed under the terms of BSD license.
########################... | 38.201923 | 90 | 0.625975 |
import sys
sys.path.append("..")
from libRadius import *
import datetime
import time
def create_Request():
REQ=HDRItem()
REQ.Code=dictCOMMANDname2code("Accounting-Request")
REQ.Identifier=1
auth=createZeroAuthenticator()
REQ_avps=[]
REQ_avps.append(encodeAVP('Acct-Sta... | false | true |
1c1742ae2add90cc47f0bdd9c4e53bfc52175638 | 5,663 | py | Python | src/Python/VisualizationAlgorithms/LOxGrid.py | sankhesh/vtk-examples | 2d50e847ad62ce0eb71b66c029ad8abb302cd39f | [
"Apache-2.0"
] | null | null | null | src/Python/VisualizationAlgorithms/LOxGrid.py | sankhesh/vtk-examples | 2d50e847ad62ce0eb71b66c029ad8abb302cd39f | [
"Apache-2.0"
] | null | null | null | src/Python/VisualizationAlgorithms/LOxGrid.py | sankhesh/vtk-examples | 2d50e847ad62ce0eb71b66c029ad8abb302cd39f | [
"Apache-2.0"
] | 1 | 2022-02-16T08:20:41.000Z | 2022-02-16T08:20:41.000Z | #!/usr/bin/env python
import vtk
def main():
colors = vtk.vtkNamedColors()
xyxFile, qFile = get_program_parameters()
# Read the data.
#
pl3d = vtk.vtkMultiBlockPLOT3DReader()
pl3d.AutoDetectFormatOn()
pl3d.SetXYZFileName(xyxFile)
pl3d.SetQFileName(qFile)
pl3d.SetScalarFunctionNu... | 28.746193 | 78 | 0.723468 |
import vtk
def main():
colors = vtk.vtkNamedColors()
xyxFile, qFile = get_program_parameters()
pl3d = vtk.vtkMultiBlockPLOT3DReader()
pl3d.AutoDetectFormatOn()
pl3d.SetXYZFileName(xyxFile)
pl3d.SetQFileName(qFile)
pl3d.SetScalarFunctionNumber(153)
pl3d.SetVectorFunctionNumbe... | true | true |
1c1742d500628e7c711a9998c3f41f6876f8bc95 | 8,090 | py | Python | baselines/jft/heteroscedastic_test.py | y0ast/uncertainty-baselines | 8d32c77ba0803ed715c1406378adf10ebd61ab74 | [
"Apache-2.0"
] | null | null | null | baselines/jft/heteroscedastic_test.py | y0ast/uncertainty-baselines | 8d32c77ba0803ed715c1406378adf10ebd61ab74 | [
"Apache-2.0"
] | null | null | null | baselines/jft/heteroscedastic_test.py | y0ast/uncertainty-baselines | 8d32c77ba0803ed715c1406378adf10ebd61ab74 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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 ap... | 44.944444 | 118 | 0.698393 |
import os.path
import pathlib
import tempfile
from absl import flags
from absl import logging
from absl.testing import flagsaver
from absl.testing import parameterized
import jax
import tensorflow as tf
import tensorflow_datasets as tfds
import checkpoint_utils import heteroscedastic import test_utils
FLAGS = fla... | true | true |
1c1743043e04bad3986d0e619619c18d7123b84d | 3,023 | py | Python | firstlanguage_python/models/input_6.py | FirstLanguage/fl-python | 1db77bbf41a78159451abb91e4e0cf3fd519ec54 | [
"MIT"
] | null | null | null | firstlanguage_python/models/input_6.py | FirstLanguage/fl-python | 1db77bbf41a78159451abb91e4e0cf3fd519ec54 | [
"MIT"
] | null | null | null | firstlanguage_python/models/input_6.py | FirstLanguage/fl-python | 1db77bbf41a78159451abb91e4e0cf3fd519ec54 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
firstlanguage_python
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
import os
from firstlanguage_python.utilities.schema_validator_wrapper import SchemaValidatorWrapper
from jsonschema import ValidationError
from firstlanguage_python.api... | 31.164948 | 119 | 0.59742 |
import os
from firstlanguage_python.utilities.schema_validator_wrapper import SchemaValidatorWrapper
from jsonschema import ValidationError
from firstlanguage_python.api_helper import APIHelper
class Input6(object):
_names = {
"question": 'question',
"lang": 'lang',
"co... | true | true |
1c17431d324d29b95b847b6650c924ef38c082ab | 19,222 | py | Python | cosmic_wimpout/cosmic_wimpout.py | burnscr/CosmicWimpout | b6e9a559e30f3648d4e9515191a3ca2c956fd515 | [
"MIT"
] | null | null | null | cosmic_wimpout/cosmic_wimpout.py | burnscr/CosmicWimpout | b6e9a559e30f3648d4e9515191a3ca2c956fd515 | [
"MIT"
] | null | null | null | cosmic_wimpout/cosmic_wimpout.py | burnscr/CosmicWimpout | b6e9a559e30f3648d4e9515191a3ca2c956fd515 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cosmic Wimpout implementation
Author: Christian Burns
Date: December 1, 2021
See: https://www.cosmicwimpout.com/how-to-play
"""
from random import choice
from typing import Optional, Dict, Any, Callable, TypeVar, List
from dice import BlackDie, WhiteDie, Face
fr... | 38.138889 | 121 | 0.603163 |
from random import choice
from typing import Optional, Dict, Any, Callable, TypeVar, List
from dice import BlackDie, WhiteDie, Face
from decorators import validate_choice
from throwables import PlayerInstantlyWon, PlayerInstantlyLost
TurnStateT = TypeVar('TurnStateT', bound='TurnState')
ScoreRule = Callable[[TurnSt... | true | true |
1c17435119065c3c3738daca3e9f120044d38a48 | 9,076 | py | Python | examples/python/builtin_private_join_and_compute.py | GeminiCarrie/incubator-teaclave | 6c33b0e9872dc0f0018fe6336fc99cf485673981 | [
"Apache-2.0"
] | null | null | null | examples/python/builtin_private_join_and_compute.py | GeminiCarrie/incubator-teaclave | 6c33b0e9872dc0f0018fe6336fc99cf485673981 | [
"Apache-2.0"
] | 1 | 2020-06-20T02:44:48.000Z | 2020-06-20T02:45:17.000Z | examples/python/builtin_private_join_and_compute.py | GeminiCarrie/incubator-teaclave | 6c33b0e9872dc0f0018fe6336fc99cf485673981 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
from teaclave import (AuthenticationService, FrontendService,
AuthenticationClient, FrontendClient, FunctionInput,
FunctionOutput, OwnerList, DataMap)
from utils import (AUTHENTICATION_SERVICE_ADDRESS, FRONTEND_SERVICE_ADDRESS,
... | 40.882883 | 110 | 0.56688 |
import sys
from teaclave import (AuthenticationService, FrontendService,
AuthenticationClient, FrontendClient, FunctionInput,
FunctionOutput, OwnerList, DataMap)
from utils import (AUTHENTICATION_SERVICE_ADDRESS, FRONTEND_SERVICE_ADDRESS,
AS_ROOT_CA_CERT_... | true | true |
1c17437279010df4eb1e02292ee4a61e8cf214f6 | 435 | py | Python | venv/lib/python3.8/site-packages/plotly/validators/sunburst/_sort.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 16 | 2020-10-26T09:57:42.000Z | 2021-11-27T13:00:01.000Z | venv/lib/python3.8/site-packages/plotly/validators/sunburst/_sort.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 1 | 2021-08-03T12:23:01.000Z | 2021-08-10T08:35:22.000Z | venv/lib/python3.8/site-packages/plotly/validators/sunburst/_sort.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 3 | 2021-01-31T16:40:52.000Z | 2021-08-29T18:32:34.000Z | import _plotly_utils.basevalidators
class SortValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="sort", parent_name="sunburst", **kwargs):
super(SortValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_... | 33.461538 | 77 | 0.648276 | import _plotly_utils.basevalidators
class SortValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="sort", parent_name="sunburst", **kwargs):
super(SortValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.