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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c017e5298210ae81338f34e82b63c9626c4387d | 7,039 | py | Python | examples/Reproduce ODE API.py | bblais/pyndamics | fc1552af4bd07ed36412c0455981bae050179ad7 | [
"MIT"
] | 12 | 2016-01-17T14:15:40.000Z | 2022-01-16T15:38:52.000Z | examples/Reproduce ODE API.py | bblais/pyndamics | fc1552af4bd07ed36412c0455981bae050179ad7 | [
"MIT"
] | 3 | 2017-06-14T17:17:57.000Z | 2020-11-02T15:33:16.000Z | examples/Reproduce ODE API.py | bblais/pyndamics | fc1552af4bd07ed36412c0455981bae050179ad7 | [
"MIT"
] | 5 | 2016-02-03T13:22:39.000Z | 2020-04-01T00:43:39.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('pylab', 'inline')
# ## Reproducing PyMC3 ODE_API_introduction
#
# https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/ODE_API_introduction.ipynb
#
# text for the equations taken from this original. All simulations done... | 21.592025 | 487 | 0.636596 |
get_ipython().run_line_magic('pylab', 'inline')
from scipy.integrate import odeint
from pyndamics import Simulation
from pyndamics.emcee import *
#
# $$ y' = mg - \gamma y $$
np.random.seed(20394)
def freefall(y, t, p):
return 2.0*p[1] - p[0]*y[0]
times = np.arange(0,10,0.5)
gamma,g, y0, sig... | true | true |
1c01808e4802a197a513bc4773444cdaa4aef336 | 88 | py | Python | demo.py | manubhai85/test | f79be36690d20e79ef414433aae7e8b5cec65d0f | [
"MIT"
] | null | null | null | demo.py | manubhai85/test | f79be36690d20e79ef414433aae7e8b5cec65d0f | [
"MIT"
] | null | null | null | demo.py | manubhai85/test | f79be36690d20e79ef414433aae7e8b5cec65d0f | [
"MIT"
] | null | null | null | def demoprint():
kvalue=input('Enter k value:')
print('now in the demo file',kvalue) | 29.333333 | 37 | 0.693182 | def demoprint():
kvalue=input('Enter k value:')
print('now in the demo file',kvalue) | true | true |
1c0182be48cd6843d8a792d76345e585edd0969a | 682 | py | Python | icomic/deseq_tsv.py | RamanLab/iCOMIC | 1310bd51641ce28d4193fa21a002767ca434fc23 | [
"Apache-2.0"
] | 1 | 2021-09-30T14:39:13.000Z | 2021-09-30T14:39:13.000Z | icomic/deseq_tsv.py | RamanLab/iCOMIC | 1310bd51641ce28d4193fa21a002767ca434fc23 | [
"Apache-2.0"
] | null | null | null | icomic/deseq_tsv.py | RamanLab/iCOMIC | 1310bd51641ce28d4193fa21a002767ca434fc23 | [
"Apache-2.0"
] | 2 | 2021-11-28T14:02:29.000Z | 2022-03-09T07:55:33.000Z | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import os
test_dir = './results/em_results'
sample = []
unit = []
condition = []
for file in os.listdir(test_dir):
if file.endswith(".counts"):
sample.append(file)
else:
pass
for i in range(len(sample)):
base = os.path.sp... | 22.733333 | 78 | 0.58651 | import numpy as np
import pandas as pd
import os
test_dir = './results/em_results'
sample = []
unit = []
condition = []
for file in os.listdir(test_dir):
if file.endswith(".counts"):
sample.append(file)
else:
pass
for i in range(len(sample)):
base = os.path.splitext(sample[i])[0]
... | true | true |
1c0182cbbe9ee611e649ffc632fcbd1f244c5375 | 1,166 | py | Python | connect_four/evaluation/incremental_victor/solution/always_useful_fake_solution.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/incremental_victor/solution/always_useful_fake_solution.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/incremental_victor/solution/always_useful_fake_solution.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | from typing import Set
from connect_four.evaluation.incremental_victor.solution.solution import Solution, SolutionType
from connect_four.problem.problem import Problem
class AlwaysUsefulFakeSolution(Solution):
def __init__(self, name: str, solvable_problems: Set[Problem], disallowed_solutions: Set[str],
... | 35.333333 | 98 | 0.711835 | from typing import Set
from connect_four.evaluation.incremental_victor.solution.solution import Solution, SolutionType
from connect_four.problem.problem import Problem
class AlwaysUsefulFakeSolution(Solution):
def __init__(self, name: str, solvable_problems: Set[Problem], disallowed_solutions: Set[str],
... | true | true |
1c0182e61999b566fbb2902421f25473da95f297 | 1,381 | py | Python | backend/vote/migrations/0001_initial.py | a-samir97/medium-clone | e1a410d694858d23286812effa4eeac663ce3707 | [
"MIT"
] | null | null | null | backend/vote/migrations/0001_initial.py | a-samir97/medium-clone | e1a410d694858d23286812effa4eeac663ce3707 | [
"MIT"
] | 34 | 2020-11-04T07:37:50.000Z | 2021-02-08T00:13:43.000Z | backend/vote/migrations/0001_initial.py | a-samir97/medium-clone | e1a410d694858d23286812effa4eeac663ce3707 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-21 02:03
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('posts', '0001_initial'),
migrations.swappable_dependency(settin... | 39.457143 | 147 | 0.640116 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('posts', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
1c0183addf3f1178849f1feea7c7dd14587a6809 | 14,171 | py | Python | server/python/rpc.py | donavanbecker/scrypted | 2ec179674eb690ed7cd3841a43efd7e83bb38158 | [
"MIT"
] | 707 | 2021-08-31T14:25:12.000Z | 2022-03-31T23:16:10.000Z | server/python/rpc.py | donavanbecker/scrypted | 2ec179674eb690ed7cd3841a43efd7e83bb38158 | [
"MIT"
] | 178 | 2021-09-09T17:04:59.000Z | 2022-03-31T14:57:41.000Z | server/python/rpc.py | donavanbecker/scrypted | 2ec179674eb690ed7cd3841a43efd7e83bb38158 | [
"MIT"
] | 60 | 2021-09-09T10:25:06.000Z | 2022-03-23T03:14:23.000Z | from asyncio.futures import Future
from typing import Any, Callable, Mapping, List
import traceback
import inspect
from typing_extensions import TypedDict
import weakref
import sys
jsonSerializable = set()
jsonSerializable.add(float)
jsonSerializable.add(int)
jsonSerializable.add(str)
jsonSerializable.add(dict)
jsonSe... | 37.991957 | 138 | 0.575471 | from asyncio.futures import Future
from typing import Any, Callable, Mapping, List
import traceback
import inspect
from typing_extensions import TypedDict
import weakref
import sys
jsonSerializable = set()
jsonSerializable.add(float)
jsonSerializable.add(int)
jsonSerializable.add(str)
jsonSerializable.add(dict)
jsonSe... | true | true |
1c0184344d3d932d0c32f8eba44b1fef8dce3ae3 | 1,666 | py | Python | utils/lib_ros_point_cloud_pub_and_sub.py | dmasatoumae/tsdf_integration_ros | 82a455bc41688635228507c36fcb5e6b6c443be1 | [
"MIT"
] | 8 | 2019-12-23T09:42:38.000Z | 2021-09-06T20:49:30.000Z | utils/lib_ros_point_cloud_pub_and_sub.py | felixchenfy/ros_pub_and_sub_rgbd_and_cloud | 28e481689e81a08c491f859a78c0058c86d4ebee | [
"MIT"
] | null | null | null | utils/lib_ros_point_cloud_pub_and_sub.py | felixchenfy/ros_pub_and_sub_rgbd_and_cloud | 28e481689e81a08c491f859a78c0058c86d4ebee | [
"MIT"
] | null | null | null | '''
Publisher/Subscriber for point cloud.
'''
from lib_cloud_conversion_between_Open3D_and_ROS import convertCloudFromOpen3dToRos, convertCloudFromRosToOpen3d
from sensor_msgs.msg import PointCloud2
import rospy
import queue
class PointCloudPublisher(object):
def __init__(self, topic_name):
self._pub ... | 32.666667 | 112 | 0.687875 |
from lib_cloud_conversion_between_Open3D_and_ROS import convertCloudFromOpen3dToRos, convertCloudFromRosToOpen3d
from sensor_msgs.msg import PointCloud2
import rospy
import queue
class PointCloudPublisher(object):
def __init__(self, topic_name):
self._pub = rospy.Publisher(topic_name, PointCloud2, que... | true | true |
1c01856e790fadee35a278efc67bd12df0333971 | 2,637 | py | Python | src/genie/libs/parser/iosxe/tests/ShowMplsLdpDiscovery/cli/equal/golden_output_all_detail_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxe/tests/ShowMplsLdpDiscovery/cli/equal/golden_output_all_detail_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxe/tests/ShowMplsLdpDiscovery/cli/equal/golden_output_all_detail_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"vrf": {
"default": {
"local_ldp_identifier": {
"10.169.197.254:0": {
"discovery_sources": {
"interfaces": {
"GigabitEthernet0/0/0": {
"session": "ldp",
... | 47.945455 | 81 | 0.263178 | expected_output = {
"vrf": {
"default": {
"local_ldp_identifier": {
"10.169.197.254:0": {
"discovery_sources": {
"interfaces": {
"GigabitEthernet0/0/0": {
"session": "ldp",
... | true | true |
1c01863ae6fe8b54265f84866750e149d30d80dc | 14,038 | py | Python | corehq/apps/reports/sqlreport.py | twymer/commcare-hq | 318927ae22771841fd7b2f3817aac5041124ea6a | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/reports/sqlreport.py | twymer/commcare-hq | 318927ae22771841fd7b2f3817aac5041124ea6a | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/reports/sqlreport.py | twymer/commcare-hq | 318927ae22771841fd7b2f3817aac5041124ea6a | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
from functools import reduce
from django.template.defaultfilters import slugify
import sqlagg
from memoized import memoized
from sqlagg.columns import SimpleColumn
from sqlagg.filters import RawFilter, SqlFilter
from corehq.apps.reports.api import ReportDataSource
from corehq.apps... | 32.953052 | 117 | 0.625873 | from collections import OrderedDict
from functools import reduce
from django.template.defaultfilters import slugify
import sqlagg
from memoized import memoized
from sqlagg.columns import SimpleColumn
from sqlagg.filters import RawFilter, SqlFilter
from corehq.apps.reports.api import ReportDataSource
from corehq.apps... | true | true |
1c018661aa52ff1d9db9f807b7e71e8603f537d3 | 4,005 | py | Python | examples/dcgan/net.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 3,705 | 2017-06-01T07:36:12.000Z | 2022-03-30T10:46:15.000Z | examples/dcgan/net.py | hitsgub/chainer | 20d4d70f5cdacc1f24f243443f5bebc2055c8f8e | [
"MIT"
] | 5,998 | 2017-06-01T06:40:17.000Z | 2022-03-08T01:42:44.000Z | examples/dcgan/net.py | hitsgub/chainer | 20d4d70f5cdacc1f24f243443f5bebc2055c8f8e | [
"MIT"
] | 1,150 | 2017-06-02T03:39:46.000Z | 2022-03-29T02:29:32.000Z | #!/usr/bin/env python
import numpy
import chainer
import chainer.functions as F
import chainer.links as L
import chainerx
def add_noise(device, h, sigma=0.2):
if chainer.config.train:
xp = device.xp
# TODO(niboshi): Support random.randn in ChainerX
if device.xp is chainerx:
fa... | 43.064516 | 79 | 0.588514 | import numpy
import chainer
import chainer.functions as F
import chainer.links as L
import chainerx
def add_noise(device, h, sigma=0.2):
if chainer.config.train:
xp = device.xp
if device.xp is chainerx:
fallback_device = device.fallback_device
with chainer.using_de... | true | true |
1c0188f7d43e9db798025d0b0835ae7ad66c848c | 7,586 | py | Python | app/rendering.py | Princessgladys/googleresourcefinder | 7715276b3c588f7c457de04944559052c8170f7e | [
"Apache-2.0"
] | null | null | null | app/rendering.py | Princessgladys/googleresourcefinder | 7715276b3c588f7c457de04944559052c8170f7e | [
"Apache-2.0"
] | null | null | null | app/rendering.py | Princessgladys/googleresourcefinder | 7715276b3c588f7c457de04944559052c8170f7e | [
"Apache-2.0"
] | null | null | null | # Copyright 2009-2010 by Ka-Ping Yee
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 41.681319 | 80 | 0.698919 |
import cache
import re
import sets
import simplejson
import sys
from feedlib.geo import distance
from model import Attribute, Subject, SubjectType, Message, MinimalSubject
from utils import Date, DateTime, HIDDEN_ATTRIBUTE_NAMES
from utils import db, get_locale
def make_jobjects(entities, transformer, *args):
job... | true | true |
1c0188f969e63d35026803dbf920b5a12f7d75cf | 12,648 | py | Python | specs/d3d9caps.py | prahal/apitrace | e9426dd61586757d23d7dddc85b3076f477e7f07 | [
"MIT"
] | 1 | 2020-06-19T12:34:44.000Z | 2020-06-19T12:34:44.000Z | specs/d3d9caps.py | prahal/apitrace | e9426dd61586757d23d7dddc85b3076f477e7f07 | [
"MIT"
] | null | null | null | specs/d3d9caps.py | prahal/apitrace | e9426dd61586757d23d7dddc85b3076f477e7f07 | [
"MIT"
] | null | null | null | ##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | 29.971564 | 79 | 0.716872 |
from winapi import *
from d3d9types import *
D3DVS20CAPS = Flags(DWORD, [
"D3DVS20CAPS_PREDICATION",
])
D3DVSHADERCAPS2_0 = Struct("D3DVSHADERCAPS2_0", [
(D3DVS20CAPS, "Caps"),
(INT, "DynamicFlowControlDepth"),
(INT, "NumTemps"),
(INT, "StaticFlowControlDepth"),
])
D3DPS20CAPS = Flags(DWORD, [
... | true | true |
1c01892f40821d4a23544ef23315232e04298cbb | 514 | py | Python | homework06/lmerlin/leroyparser/runner.py | Selen34/scraping | f7c179244318d5c5d0347886065b4e504baee94d | [
"Unlicense"
] | null | null | null | homework06/lmerlin/leroyparser/runner.py | Selen34/scraping | f7c179244318d5c5d0347886065b4e504baee94d | [
"Unlicense"
] | null | null | null | homework06/lmerlin/leroyparser/runner.py | Selen34/scraping | f7c179244318d5c5d0347886065b4e504baee94d | [
"Unlicense"
] | null | null | null | from scrapy.crawler import CrawlerProcess
from scrapy.settings import Settings
from leroyparser import settings
from leroyparser.spiders.leroy import LeroySpider
if __name__ == '__main__':
# generatory etc
search = 'shtukaturki'
print('UPLOAD SECTION:', search)
# search = input()
crawler_settings =... | 30.235294 | 55 | 0.747082 | from scrapy.crawler import CrawlerProcess
from scrapy.settings import Settings
from leroyparser import settings
from leroyparser.spiders.leroy import LeroySpider
if __name__ == '__main__':
search = 'shtukaturki'
print('UPLOAD SECTION:', search)
crawler_settings = Settings()
crawler_settings.set... | true | true |
1c01893ceca88a45d1f638f0116aafea3361aa27 | 60,626 | py | Python | tests/Node.py | b1-anka-admin/eos | 448287d520f5f8c282139ecc60f227c218d42e82 | [
"MIT"
] | 32 | 2018-07-02T09:33:40.000Z | 2019-03-29T08:07:19.000Z | tests/Node.py | b1-anka-admin/eos | 448287d520f5f8c282139ecc60f227c218d42e82 | [
"MIT"
] | 2 | 2018-10-15T10:40:21.000Z | 2018-10-26T08:34:49.000Z | tests/Node.py | b1-anka-admin/eos | 448287d520f5f8c282139ecc60f227c218d42e82 | [
"MIT"
] | 9 | 2018-09-30T14:02:40.000Z | 2019-02-23T09:32:09.000Z | import copy
import decimal
import subprocess
import time
import os
import re
import datetime
import json
import signal
from core_symbol import CORE_SYMBOL
from testUtils import Utils
from testUtils import Account
from testUtils import EnumType
from testUtils import addEnum
from testUtils import unhandledEnumType
clas... | 43.273376 | 208 | 0.609705 | import copy
import decimal
import subprocess
import time
import os
import re
import datetime
import json
import signal
from core_symbol import CORE_SYMBOL
from testUtils import Utils
from testUtils import Account
from testUtils import EnumType
from testUtils import addEnum
from testUtils import unhandledEnumType
clas... | true | true |
1c0189c0a43f7071c62cff18bf032f761fcb5861 | 2,288 | py | Python | acme/agents/mpo/agent_test.py | owenshen24/acme | 71434dffd3449236f9b8aaf7a53ceab515e75a2a | [
"Apache-2.0"
] | 1 | 2020-06-03T18:33:40.000Z | 2020-06-03T18:33:40.000Z | acme/agents/mpo/agent_test.py | owenshen24/acme | 71434dffd3449236f9b8aaf7a53ceab515e75a2a | [
"Apache-2.0"
] | null | null | null | acme/agents/mpo/agent_test.py | owenshen24/acme | 71434dffd3449236f9b8aaf7a53ceab515e75a2a | [
"Apache-2.0"
] | 1 | 2021-11-26T22:51:55.000Z | 2021-11-26T22:51:55.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 28.6 | 79 | 0.732955 |
from absl.testing import absltest
import acme
from acme import networks
from acme import specs
from acme.agents import mpo
from acme.testing import fakes
import numpy as np
import sonnet as snt
def make_networks(
action_spec,
policy_layer_sizes=(10, 10),
critic_layer_sizes=(10, 10),
):
num_dimensio... | true | true |
1c0189f8b92784b95dd00b2465ef151f927a05f6 | 9,044 | py | Python | tests/test_DistGCN/prepare_data_GCN15d.py | initzhang/Hetu | 447111a358e4dc6df5db9c216bdb3590fff05f84 | [
"Apache-2.0"
] | 82 | 2021-07-20T02:45:54.000Z | 2022-03-14T07:08:45.000Z | tests/test_DistGCN/prepare_data_GCN15d.py | initzhang/Hetu | 447111a358e4dc6df5db9c216bdb3590fff05f84 | [
"Apache-2.0"
] | 4 | 2021-11-25T13:39:21.000Z | 2022-03-13T04:14:14.000Z | tests/test_DistGCN/prepare_data_GCN15d.py | initzhang/Hetu | 447111a358e4dc6df5db9c216bdb3590fff05f84 | [
"Apache-2.0"
] | 13 | 2021-07-18T14:40:56.000Z | 2022-03-09T06:37:42.000Z | from graphmix import Graph
import numpy as np
import scipy.sparse as sp
import os
import sys
import math
import argparse
import pickle as pkl
import networkx as nx
'''
Usage example: (in Dir Hetu/)
python ./tests/test_DistGCN/prepare_data_GCN15d.py --size 8 --replication 2 --dataset Reddit
'''
def coo_slice(a, ... | 35.606299 | 171 | 0.602609 | from graphmix import Graph
import numpy as np
import scipy.sparse as sp
import os
import sys
import math
import argparse
import pickle as pkl
import networkx as nx
def coo_slice(a, row_range, col_range):
a = a.tocoo()
condition = np.where((a.row >= row_range[0]) & (a.row < row_range[1]) & (
a.col >=... | true | true |
1c018ba43b93de12d8db270787904dad646e856c | 2,410 | py | Python | flaky/flaky_decorator.py | spothero/flaky | 7715757fbbcfd8208b9b632277b514e8e2af956c | [
"Apache-2.0"
] | null | null | null | flaky/flaky_decorator.py | spothero/flaky | 7715757fbbcfd8208b9b632277b514e8e2af956c | [
"Apache-2.0"
] | 2 | 2015-10-27T12:05:55.000Z | 2015-10-27T19:59:07.000Z | flaky/flaky_decorator.py | benpatterson/flaky | 7715757fbbcfd8208b9b632277b514e8e2af956c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from flaky.defaults import default_flaky_attributes
def flaky(max_runs=None, min_passes=None, rerun_filter=None):
"""
Decorator used to mark a test as "flaky". When used in conjuction with
the flaky nosetests plugin, will cause the decorated test t... | 37.65625 | 78 | 0.660996 |
from __future__ import unicode_literals
from flaky.defaults import default_flaky_attributes
def flaky(max_runs=None, min_passes=None, rerun_filter=None):
wrapped = None
if hasattr(max_runs, '__call__'):
wrapped, max_runs = max_runs, None
if max_runs is None:
max_runs = 2
... | true | true |
1c018c7918b19d4312ca171dbe2b22ea3a81044d | 8,517 | py | Python | utils/llvm-bolt-wrapper.py | kmod/BOLT | 89acda4c0273c6896fe9797ffdb8f0c126206ec4 | [
"NCSA"
] | null | null | null | utils/llvm-bolt-wrapper.py | kmod/BOLT | 89acda4c0273c6896fe9797ffdb8f0c126206ec4 | [
"NCSA"
] | null | null | null | utils/llvm-bolt-wrapper.py | kmod/BOLT | 89acda4c0273c6896fe9797ffdb8f0c126206ec4 | [
"NCSA"
] | null | null | null | #!/usr/bin/env python3
import argparse
import subprocess
from typing import *
import tempfile
import copy
import os
import shutil
import sys
import re
import configparser
# USAGE:
# 0. Prepare two BOLT build versions: base and compare
# In base BOLT build directory:
# 1. Rename `llvm-bolt` to `llvm-bolt.real`
# 2. Cre... | 33.531496 | 85 | 0.659387 | import argparse
import subprocess
from typing import *
import tempfile
import copy
import os
import shutil
import sys
import re
import configparser
cfg = configparser.ConfigParser(allow_no_value = True)
cfgs = cfg.read("llvm-bolt-wrapper.ini")
assert cfgs, f"llvm-bolt-wrapper.ini is not found in {os.getcwd()}"
BASE... | true | true |
1c018cdc86138d89fbe7de884cb84c96d5672ed5 | 8,363 | py | Python | tensorflow_examples/lite/model_maker/core/task/configs.py | poposca/digit_classifier | 63d1515b576b6f984fcf1eea5c6a4d6bc040be16 | [
"Apache-2.0"
] | null | null | null | tensorflow_examples/lite/model_maker/core/task/configs.py | poposca/digit_classifier | 63d1515b576b6f984fcf1eea5c6a4d6bc040be16 | [
"Apache-2.0"
] | null | null | null | tensorflow_examples/lite/model_maker/core/task/configs.py | poposca/digit_classifier | 63d1515b576b6f984fcf1eea5c6a4d6bc040be16 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.597087 | 80 | 0.72462 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow_examples.lite.model_maker.core import compat
from tensorflow_examples.lite.model_maker.core.api import mm_export
DEFAULT_QUANTIZATION_STEPS = 2000
def _get_representa... | true | true |
1c018ced4752e5a5df054f1ec15e8bfdecbdeef2 | 79 | py | Python | kafka_rpc/__init__.py | zylo117/krpc | d4227f847e0e81cb3f32d42b201524afb9d9e5b3 | [
"Apache-2.0"
] | 11 | 2020-01-05T08:27:23.000Z | 2022-03-16T19:25:12.000Z | kafka_rpc/__init__.py | zylo117/krpc | d4227f847e0e81cb3f32d42b201524afb9d9e5b3 | [
"Apache-2.0"
] | 1 | 2020-07-22T14:25:34.000Z | 2020-07-23T03:25:02.000Z | kafka_rpc/__init__.py | zylo117/krpc | d4227f847e0e81cb3f32d42b201524afb9d9e5b3 | [
"Apache-2.0"
] | 2 | 2020-01-05T08:27:27.000Z | 2020-11-26T20:07:27.000Z | from kafka_rpc.client import KRPCClient
from kafka_rpc.server import KRPCServer | 39.5 | 39 | 0.886076 | from kafka_rpc.client import KRPCClient
from kafka_rpc.server import KRPCServer | true | true |
1c018de6b5124274982537dcc488a714f38956b5 | 3,515 | py | Python | scoring_engine/engine/util.py | UMCST/scoringengine | ec0c931cc6f8c5994df46447fdf8413cca242b79 | [
"MIT"
] | 1 | 2021-03-20T14:13:05.000Z | 2021-03-20T14:13:05.000Z | scoring_engine/engine/util.py | UMCST/scoringengine | ec0c931cc6f8c5994df46447fdf8413cca242b79 | [
"MIT"
] | null | null | null | scoring_engine/engine/util.py | UMCST/scoringengine | ec0c931cc6f8c5994df46447fdf8413cca242b79 | [
"MIT"
] | null | null | null | from typing import List
from scoring_engine.db import session
from scoring_engine.models.check import Check
from scoring_engine.models.round import Round
from scoring_engine.models.score import Score
from scoring_engine.models.service import Service
from scoring_engine.models.setting import Setting
def update_scores... | 35.15 | 88 | 0.659175 | from typing import List
from scoring_engine.db import session
from scoring_engine.models.check import Check
from scoring_engine.models.round import Round
from scoring_engine.models.score import Score
from scoring_engine.models.service import Service
from scoring_engine.models.setting import Setting
def update_scores... | true | true |
1c018ee7c1a9b48a263924a4ca07e8d080625a6a | 1,498 | py | Python | chapter12/drive_distance_behavior.py | PacktPublishing/Learn-Robotics---Fundamentals-of-Robotics-Programming | 7f38c27c4459f3fd2cffff9c037784e6d7f2f5a2 | [
"MIT"
] | 33 | 2019-01-09T20:41:20.000Z | 2022-03-21T10:30:06.000Z | chapter12/drive_distance_behavior.py | PacktPublishing/Learn-Robotics---Fundamentals-of-Robotics-Programming | 7f38c27c4459f3fd2cffff9c037784e6d7f2f5a2 | [
"MIT"
] | 3 | 2020-06-13T21:05:06.000Z | 2021-09-01T19:18:19.000Z | chapter12/drive_distance_behavior.py | PacktPublishing/Learn-Robotics---Fundamentals-of-Robotics-Programming | 7f38c27c4459f3fd2cffff9c037784e6d7f2f5a2 | [
"MIT"
] | 9 | 2018-12-20T09:49:09.000Z | 2021-12-13T06:19:06.000Z | from robot import Robot, EncoderCounter
from pid_controller import PIController
import time
def drive_distance(bot, distance, speed=80):
# Use left as "primary" motor, the right is keeping up
set_primary = bot.set_left
primary_encoder = bot.left_encoder
set_secondary = bot.set... | 38.410256 | 94 | 0.678238 | from robot import Robot, EncoderCounter
from pid_controller import PIController
import time
def drive_distance(bot, distance, speed=80):
set_primary = bot.set_left
primary_encoder = bot.left_encoder
set_secondary = bot.set_right
secondary_encoder = bot.right_encoder
... | true | true |
1c018f0b0940df873f81ae73b8b9411478ff04ac | 1,618 | py | Python | azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.772727 | 76 | 0.631026 |
from msrest.serialization import Model
class LegalHoldProperties(Model):
_validation = {
'has_legal_hold': {'readonly': True},
}
_attribute_map = {
'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'},
'tags': {'key': 'tags', 'type': '[TagProperty]'},
}
def __init_... | true | true |
1c018f21a82362a4c6be4f7dab5dab2b30bd23ee | 533 | py | Python | .modules/.CMSeeK/deepscans/joom/check_debug.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.CMSeeK/deepscans/joom/check_debug.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.CMSeeK/deepscans/joom/check_debug.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 161 | 2018-04-20T15:57:12.000Z | 2022-03-15T19:16:16.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 Tuhinshubhra
import cmseekdb.basic as cmseek
# I know there is no reason at all to create a separate module for this.. there's something that's going to be added here so.. trust me!
d... | 35.533333 | 136 | 0.682927 |
import cmseekdb.basic as cmseek
def start(source):
if 'Joomla! Debug Console' in source or 'xdebug.org/docs/all_settings' in source:
cmseek.success('Debug mode on!')
return '1'
else:
return '0'
| true | true |
1c018f477ca5c73390111841425accf7c203f913 | 3,477 | py | Python | examples/python/mcc118/single_value_read.py | patalen/daqhats | 90d5a47f5cf5dd8103632df70a9266c4245d9862 | [
"MIT"
] | 88 | 2018-08-21T17:40:04.000Z | 2022-02-16T05:34:51.000Z | examples/python/mcc118/single_value_read.py | patalen/daqhats | 90d5a47f5cf5dd8103632df70a9266c4245d9862 | [
"MIT"
] | 30 | 2019-02-20T17:47:01.000Z | 2021-11-17T21:40:17.000Z | examples/python/mcc118/single_value_read.py | patalen/daqhats | 90d5a47f5cf5dd8103632df70a9266c4245d9862 | [
"MIT"
] | 59 | 2018-08-13T18:00:16.000Z | 2022-03-11T16:12:34.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MCC 118 Functions Demonstrated:
mcc118.a_in_read
Purpose:
Read a single data value for each channel in a loop.
Description:
This example demonstrates acquiring data using a software timed loop
to read a single value from ea... | 34.77 | 76 | 0.602819 | from __future__ import print_function
from time import sleep
from sys import stdout
from daqhats import mcc118, OptionFlags, HatIDs, HatError
from daqhats_utils import select_hat_device, enum_mask_to_string
CURSOR_BACK_2 = '\x1b[2D'
ERASE_TO_END_OF_LINE = '\x1b[0K'
def main():
options = OptionFlags.DEFAULT
l... | true | true |
1c018f53dd569f65733c116b9e93be80d2a0c669 | 2,511 | py | Python | machine_learning/logistic_regression.py | caofanCPU/Python | 57d290918fd3f6af1e5c0940aed95642f931d32e | [
"MIT"
] | 1 | 2019-12-14T03:08:29.000Z | 2019-12-14T03:08:29.000Z | machine_learning/logistic_regression.py | caofanCPU/Python | 57d290918fd3f6af1e5c0940aed95642f931d32e | [
"MIT"
] | null | null | null | machine_learning/logistic_regression.py | caofanCPU/Python | 57d290918fd3f6af1e5c0940aed95642f931d32e | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
## Logistic Regression from scratch
# In[62]:
# In[63]:
# importing all the required libraries
''' Implementing logistic regression for classification problem
Helpful resources : 1.Coursera ML course 2.https://medium.com/@martinpella/logistic-regression-from-scrat... | 24.617647 | 141 | 0.590601 |
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
def sigmoid_function(z):
return 1 / (1 + np.exp(-z))
def cost_function(h, y):
return (-y * np.log(h) - (1 - y) * np.log(1 - h)).mean()
def logistic_reg(
alpha,
X,
y,
max_iterations=70... | true | true |
1c018f90d451f5cf13842354fcc8525271ae5d17 | 3,510 | py | Python | models/Analogy.py | prokolyvakis/hyperkg | db0b8eee78424dde31f8f691b0c6dd07c376ce73 | [
"Apache-2.0"
] | 9 | 2019-12-17T22:28:08.000Z | 2022-01-26T17:47:55.000Z | models/Analogy.py | prokolyvakis/hyperkg | db0b8eee78424dde31f8f691b0c6dd07c376ce73 | [
"Apache-2.0"
] | null | null | null | models/Analogy.py | prokolyvakis/hyperkg | db0b8eee78424dde31f8f691b0c6dd07c376ce73 | [
"Apache-2.0"
] | 4 | 2019-12-17T22:28:11.000Z | 2021-05-24T04:41:12.000Z | #
# Copyright (c) 2018-present, the Authors of the OpenKE-PyTorch (old).
# All rights reserved.
#
# Link to the project: https://github.com/thunlp/OpenKE/tree/OpenKE-PyTorch(old)
#
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
impor... | 48.082192 | 191 | 0.780057 |
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from .Model import Model
class Analogy(Model):
def __init__(self,config):
super(Analogy,self).__init__(config)
self.ent_re_embeddings=nn.Embedding(self.config.entTot... | true | true |
1c018f911068634dd4b697387fbf43544de2248b | 8,992 | py | Python | pyscf/tdscf/rks.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | pyscf/tdscf/rks.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | pyscf/tdscf/rks.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 33.804511 | 100 | 0.587633 |
from functools import reduce
import numpy
from pyscf import lib
from pyscf import symm
from pyscf.dft import numint
from pyscf.tdscf import rhf
from pyscf.scf import hf_symm
from pyscf.ao2mo import _ao2mo
from pyscf.data import nist
from pyscf.soscf.newton_ah import _gen_rhf_response
from pyscf import __config__
POST... | true | true |
1c018fea66239d519bbdd862b5835ca2f7c73fa0 | 170 | py | Python | tools/generate_docs.py | conductiveIT/pymunk-1 | 61de8b2e652503356ac14a2d648cc11aa6a8070f | [
"MIT"
] | 670 | 2015-01-01T19:10:15.000Z | 2022-03-29T23:05:47.000Z | tools/generate_docs.py | reter695/pymunk | 9e9d3bf14cd57f61006588b1c56fefc21b453733 | [
"MIT"
] | 122 | 2015-01-02T19:06:19.000Z | 2022-03-20T19:44:25.000Z | tools/generate_docs.py | reter695/pymunk | 9e9d3bf14cd57f61006588b1c56fefc21b453733 | [
"MIT"
] | 222 | 2015-01-28T03:34:52.000Z | 2022-03-27T06:44:52.000Z | import os
import sys
def main():
os.system("""python -m sphinx -E -b html ../docs/src ../docs/html""")
if __name__ == "__main__":
sys.exit(main())
| 15.454545 | 75 | 0.558824 | import os
import sys
def main():
os.system("""python -m sphinx -E -b html ../docs/src ../docs/html""")
if __name__ == "__main__":
sys.exit(main())
| true | true |
1c01901a9cfeaa6279b79a098d1b203ae0edada6 | 4,935 | py | Python | pythonforandroid/recipes/protobuf_cpp/__init__.py | clevermindgames/python-for-android-kivmob27 | 81c1505e42fda6f7fd6c1a8001bead11c62a9b92 | [
"MIT"
] | 1 | 2020-08-10T18:16:28.000Z | 2020-08-10T18:16:28.000Z | pythonforandroid/recipes/protobuf_cpp/__init__.py | syno3/python-for-android | cf6164df3798bb925ae7a5356b6e8a47cf9bb34e | [
"MIT"
] | null | null | null | pythonforandroid/recipes/protobuf_cpp/__init__.py | syno3/python-for-android | cf6164df3798bb925ae7a5356b6e8a47cf9bb34e | [
"MIT"
] | null | null | null | from pythonforandroid.recipe import PythonRecipe
from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory, shutil
from os.path import exists, join, dirname
import sh
from multiprocessing import cpu_count
from pythonforandroid.toolchain import info
class ProtobufCppRecipe(Pytho... | 43.672566 | 150 | 0.559878 | from pythonforandroid.recipe import PythonRecipe
from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory, shutil
from os.path import exists, join, dirname
import sh
from multiprocessing import cpu_count
from pythonforandroid.toolchain import info
class ProtobufCppRecipe(Pytho... | true | true |
1c019046279f497e4eae3f839f683bc0b1193c6b | 3,556 | py | Python | hparams.py | lethalbas/W2L-GUI | e00385fdc301ccf5be3b6cac2f236f882722295e | [
"Apache-2.0"
] | 40 | 2021-06-26T13:17:08.000Z | 2022-02-15T13:00:08.000Z | hparams.py | lethalbas/W2L-GUI | e00385fdc301ccf5be3b6cac2f236f882722295e | [
"Apache-2.0"
] | 3 | 2021-09-23T09:35:12.000Z | 2022-01-23T18:02:15.000Z | hparams.py | lethalbas/W2L-GUI | e00385fdc301ccf5be3b6cac2f236f882722295e | [
"Apache-2.0"
] | 3 | 2021-06-29T03:53:39.000Z | 2022-02-15T02:25:48.000Z | from glob import glob
import os
def get_image_list(data_root, split):
filelist = []
with open('filelists/{}.txt'.format(split)) as f:
for line in f:
line = line.strip()
if ' ' in line: line = line.split()[0]
filelist.append(os.path.join(data_root, line))
return filelist
class HParams:
def __init__(se... | 34.862745 | 122 | 0.724128 | from glob import glob
import os
def get_image_list(data_root, split):
filelist = []
with open('filelists/{}.txt'.format(split)) as f:
for line in f:
line = line.strip()
if ' ' in line: line = line.split()[0]
filelist.append(os.path.join(data_root, line))
return filelist
class HParams:
def __init__(se... | true | true |
1c0190cb63b0d7025c7dceb751f5f81cea1db7c9 | 13,957 | py | Python | tests/certification/required/test_cert_echeck_dict.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 4 | 2017-11-16T16:02:06.000Z | 2021-05-04T14:40:08.000Z | tests/certification/required/test_cert_echeck_dict.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 7 | 2017-08-23T15:04:38.000Z | 2020-04-07T20:20:15.000Z | tests/certification/required/test_cert_echeck_dict.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 13 | 2017-10-17T22:07:57.000Z | 2022-03-29T17:33:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Vantiv eCommerce
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the 'Software'), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, ... | 35.156171 | 118 | 0.482339 |
import os
import sys
import unittest
package_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))))
sys.path.insert(0, package_root)
from vantivsdk import *
package_root = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
sys.path.insert(0, package_root)
impor... | true | true |
1c019112a4881d006d5df12024825772be9e2df5 | 159 | py | Python | AD999-flask-admin-composite/app/admin/modelviews/tag_view.py | AngelLiang/Flask-Demos | cf0a74885b873cb2583b3870ccdf3508d3af602e | [
"MIT"
] | 3 | 2020-06-17T05:44:48.000Z | 2021-09-11T02:49:38.000Z | AD999-flask-admin-composite/app/admin/modelviews/tag_view.py | AngelLiang/Flask-Demos | cf0a74885b873cb2583b3870ccdf3508d3af602e | [
"MIT"
] | 3 | 2021-06-08T20:57:03.000Z | 2022-02-23T14:54:59.000Z | AD999-flask-admin-composite/app/admin/modelviews/tag_view.py | AngelLiang/Flask-Demos | cf0a74885b873cb2583b3870ccdf3508d3af602e | [
"MIT"
] | 6 | 2020-06-17T05:44:56.000Z | 2022-03-29T12:53:05.000Z | from app.models import Post, Tag
from .base import ModelView
class TagModelView(ModelView):
column_list = ('name',)
column_default_sort = 'name'
| 13.25 | 32 | 0.710692 | from app.models import Post, Tag
from .base import ModelView
class TagModelView(ModelView):
column_list = ('name',)
column_default_sort = 'name'
| true | true |
1c0191a410472ab67d6437be08cea3448397c05d | 583 | py | Python | OOPS/__getitem__.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 37 | 2019-04-03T07:19:57.000Z | 2022-01-09T06:18:41.000Z | OOPS/__getitem__.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 16 | 2020-08-11T08:09:42.000Z | 2021-10-30T17:40:48.000Z | OOPS/__getitem__.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 130 | 2019-10-02T14:40:20.000Z | 2022-01-26T17:38:26.000Z | class A:
def __init__(self):
self.l=[1,2,3,4,5,6,7,8,9]
def __getitem__(self,i):
if isinstance(i,int):
return self.l[i]
else:
print(i.start,i.stop,i.step)
return self.l[i]
a=A()
#for i in a.l:
# print(i,end='\t')
print(a[4])
print(a[:])
print(a[2:])
print(a[:5])
print(a[3:8])
print(a[::2])
print(a[:4... | 13.55814 | 31 | 0.535163 | class A:
def __init__(self):
self.l=[1,2,3,4,5,6,7,8,9]
def __getitem__(self,i):
if isinstance(i,int):
return self.l[i]
else:
print(i.start,i.stop,i.step)
return self.l[i]
a=A()
print(a[4])
print(a[:])
print(a[2:])
print(a[:5])
print(a[3:8])
print(a[::2])
print(a[:4:3])
print(a[4::3])
print(a[2:9:2])... | true | true |
1c01937b05fb3378c34a6a307ff4ec6c055f902a | 4,057 | py | Python | src/oci/data_labeling_service_dataplane/models/generic_entity.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_labeling_service_dataplane/models/generic_entity.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_labeling_service_dataplane/models/generic_entity.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 35.587719 | 245 | 0.66108 |
from .entity import Entity
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class GenericEntity(Entity):
def __init__(self, **kwargs):
self.swagger_types = {
'en... | true | true |
1c01946aa34471b7914846b9e66ada6c9120635b | 928 | py | Python | t/data/target_location.py | tek/vim-pymport | ea918179d11a78a4e946afec1e8052e50ddd2ef7 | [
"MIT"
] | null | null | null | t/data/target_location.py | tek/vim-pymport | ea918179d11a78a4e946afec1e8052e50ddd2ef7 | [
"MIT"
] | null | null | null | t/data/target_location.py | tek/vim-pymport | ea918179d11a78a4e946afec1e8052e50ddd2ef7 | [
"MIT"
] | null | null | null | ''' foo
moo
'''
import re
import itertools
from os import path
import thirdparty.fluff
from thirdparty.stuff import Stuff
from thirdparty.fluff import Fluff # NOQA
from fourthparty import nothing
from fourthparty.mudule import LooooooooooooongButNotLongEnough, ToBreakTheLine
from fourthparty.sub import (Loooooooooo... | 16.280702 | 79 | 0.594828 |
import re
import itertools
from os import path
import thirdparty.fluff
from thirdparty.stuff import Stuff
from thirdparty.fluff import Fluff
from fourthparty import nothing
from fourthparty.mudule import LooooooooooooongButNotLongEnough, ToBreakTheLine
from fourthparty.sub import (LoooooooooooooooooooongAssName, An... | true | true |
1c0194e9b2701f891b7f203b35734f66d6e27154 | 95 | py | Python | examples/options/exec.py | AkshayJainG/satellite | 1d8ac7c208d490eed80eb101d3da12ab2177df2f | [
"MIT"
] | 220 | 2020-01-21T17:32:32.000Z | 2022-03-25T17:37:00.000Z | examples/options/exec.py | AkshayJainG/satellite | 1d8ac7c208d490eed80eb101d3da12ab2177df2f | [
"MIT"
] | 17 | 2020-01-24T15:59:26.000Z | 2021-06-28T01:49:09.000Z | examples/options/exec.py | AkshayJainG/satellite | 1d8ac7c208d490eed80eb101d3da12ab2177df2f | [
"MIT"
] | 35 | 2020-01-21T22:56:17.000Z | 2022-03-10T03:59:03.000Z | #!/usr/bin/env python3
import sys
req = sys.stdin.read()
if 'abc123' in req:
print('ok')
| 11.875 | 22 | 0.631579 | import sys
req = sys.stdin.read()
if 'abc123' in req:
print('ok')
| true | true |
1c0196a434742a480969faced7db7e61749f72a3 | 1,090 | py | Python | Lista3/Lista3ex5.py | hugo-paiva/IntroducaoCienciasDaComputacao | a563f2fd5b773acbffaf4c858b86423b1130ae1f | [
"MIT"
] | null | null | null | Lista3/Lista3ex5.py | hugo-paiva/IntroducaoCienciasDaComputacao | a563f2fd5b773acbffaf4c858b86423b1130ae1f | [
"MIT"
] | null | null | null | Lista3/Lista3ex5.py | hugo-paiva/IntroducaoCienciasDaComputacao | a563f2fd5b773acbffaf4c858b86423b1130ae1f | [
"MIT"
] | null | null | null | qtd_BH = int(input())
somatorio_bacias = 0
for c in range(qtd_BH):
nome, area, verao, outono, inverno, primavera = input().split()
area, verao, outono, inverno, primavera = [
float(area),
float(verao),
... | 33.030303 | 65 | 0.566972 | qtd_BH = int(input())
somatorio_bacias = 0
for c in range(qtd_BH):
nome, area, verao, outono, inverno, primavera = input().split()
area, verao, outono, inverno, primavera = [
float(area),
float(verao),
... | true | true |
1c019739bd87058665424ec95c4aa42900717ed8 | 75 | py | Python | arcade_solutions/the_core/is_unstable_pair.py | nickaigi/automatic-dollop | eb8222475c7871c1d5710242c5aed8c70ea0d2c8 | [
"Unlicense"
] | null | null | null | arcade_solutions/the_core/is_unstable_pair.py | nickaigi/automatic-dollop | eb8222475c7871c1d5710242c5aed8c70ea0d2c8 | [
"Unlicense"
] | null | null | null | arcade_solutions/the_core/is_unstable_pair.py | nickaigi/automatic-dollop | eb8222475c7871c1d5710242c5aed8c70ea0d2c8 | [
"Unlicense"
] | null | null | null | def is_unstable_pair(a, b):
return (a.upper() < b.upper()) != ( a < b)
| 25 | 46 | 0.546667 | def is_unstable_pair(a, b):
return (a.upper() < b.upper()) != ( a < b)
| true | true |
1c01977e4a417d18cccf5bf13e629b687b7d39da | 41,034 | py | Python | python/ray/tests/test_failure.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_failure.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_failure.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.utils
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_uti... | 31.686486 | 79 | 0.663401 | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.utils
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_uti... | true | true |
1c0197cb0e2281f93692965db91308808dde1065 | 2,346 | py | Python | editor.py | earlideal/jiandan | 0c7c3496a9e61fb52ea3498c5cfc76d021345c0a | [
"Apache-2.0"
] | null | null | null | editor.py | earlideal/jiandan | 0c7c3496a9e61fb52ea3498c5cfc76d021345c0a | [
"Apache-2.0"
] | null | null | null | editor.py | earlideal/jiandan | 0c7c3496a9e61fb52ea3498c5cfc76d021345c0a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
from PyQt4 import QtGui
from model import Inventory
from views import editor_template
class EditorDialog(QtGui.QDialog):
def __init__(self):
super(EditorDialog, self).__init__()
self.ui = editor_template.Ui_Dialog()
self.ui.setupUi(self)
self.... | 42.654545 | 94 | 0.709719 |
import copy
from PyQt4 import QtGui
from model import Inventory
from views import editor_template
class EditorDialog(QtGui.QDialog):
def __init__(self):
super(EditorDialog, self).__init__()
self.ui = editor_template.Ui_Dialog()
self.ui.setupUi(self)
self.ui.doubleSpinBox_quantit... | false | true |
1c019961743f6cdd7ed77a77886ac5fe0d5720fc | 3,239 | py | Python | parlai/tasks/moviedialog/agents.py | zl930216/ParlAI | abf0ad6d1779af0f8ce0b5aed00d2bab71416684 | [
"MIT"
] | 9,228 | 2017-05-03T03:40:34.000Z | 2022-03-31T14:03:29.000Z | parlai/tasks/moviedialog/agents.py | zl930216/ParlAI | abf0ad6d1779af0f8ce0b5aed00d2bab71416684 | [
"MIT"
] | 2,660 | 2017-05-03T23:06:02.000Z | 2022-03-31T21:24:29.000Z | parlai/tasks/moviedialog/agents.py | zl930216/ParlAI | abf0ad6d1779af0f8ce0b5aed00d2bab71416684 | [
"MIT"
] | 2,058 | 2017-05-04T12:19:48.000Z | 2022-03-31T10:28:11.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Teachers for the MovieDialog task.
From Dodge et al. '15. Link: https://arxiv.org/abs/1511.06931
Task 1: Closed-dom... | 28.412281 | 87 | 0.618092 |
from parlai.core.teachers import FbDeprecatedDialogTeacher, MultiTaskTeacher
from .build import build
import copy
import os
tasks = {}
tasks[1] = os.path.join('task1_qa', 'task1_qa_pipe_')
tasks[2] = os.path.join('task2_recs', 'task2_recs_')
tasks[3] = os.path.join('task3_qarecs', 'task3_qarecs_pipe_')
tasks[4] = os... | true | true |
1c0199624a0f7882ef89c28205ebe949d2b30cb5 | 6,628 | py | Python | models/pt_3dpose/tools/infer.py | DreaJulca/uxsense | 538800f3e071660f4a8242c90b25f500b8667aa8 | [
"MIT"
] | 27,213 | 2018-01-22T22:28:13.000Z | 2022-03-31T15:37:11.000Z | models/pt_3dpose/tools/infer.py | DreaJulca/uxsense | 538800f3e071660f4a8242c90b25f500b8667aa8 | [
"MIT"
] | 992 | 2018-01-23T05:13:19.000Z | 2022-03-30T09:45:05.000Z | models/pt_3dpose/tools/infer.py | DreaJulca/uxsense | 538800f3e071660f4a8242c90b25f500b8667aa8 | [
"MIT"
] | 6,227 | 2018-01-22T22:28:48.000Z | 2022-03-31T12:54:07.000Z | #!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, 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 a... | 33.306533 | 92 | 0.669584 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import cv2 import logging
import os
import sys
from caffe2.python import workspace
from detectron.core.config import assert_and_infer_cfg
from detec... | true | true |
1c019a154c2fa7bce2770a61583dbd83dfab4e15 | 1,006 | py | Python | scripts/spam-filter/LinearSVCModel.py | atb00ker/scripts-lab | 71a5cc9c7f301c274798686db4a227e84b65926a | [
"MIT"
] | 2 | 2020-03-16T17:18:20.000Z | 2020-10-19T05:11:19.000Z | scripts/spam-filter/LinearSVCModel.py | atb00ker/scripts-lab | 71a5cc9c7f301c274798686db4a227e84b65926a | [
"MIT"
] | null | null | null | scripts/spam-filter/LinearSVCModel.py | atb00ker/scripts-lab | 71a5cc9c7f301c274798686db4a227e84b65926a | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
# scikit-learn
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from sklearn.svm import LinearSVC
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split, cross_val_score
# DataSet
data_s... | 29.588235 | 83 | 0.796223 | import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from sklearn.svm import LinearSVC
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split, cross_val_score
data_set = pd.read_csv('SpamCol... | true | true |
1c019a38202b8c88684c935fa287832e3ca7325e | 7,990 | py | Python | skulpt/src/lib/unittest/__init__.py | kushal4/blockpy | 7da22c735315a1eaa1260be355c552465044ca7a | [
"Apache-2.0"
] | 8 | 2016-07-17T22:17:39.000Z | 2021-01-22T19:03:21.000Z | skulpt/src/lib/unittest/__init__.py | kushal4/blockpy | 7da22c735315a1eaa1260be355c552465044ca7a | [
"Apache-2.0"
] | 1 | 2016-07-31T23:42:11.000Z | 2016-07-31T23:42:11.000Z | skulpt/src/lib/unittest/__init__.py | kushal4/blockpy | 7da22c735315a1eaa1260be355c552465044ca7a | [
"Apache-2.0"
] | 2 | 2016-08-06T06:37:00.000Z | 2019-02-23T16:44:06.000Z | __author__ = 'bmiller'
'''
This is the start of something that behaves like
the unittest module from cpython.
'''
class TestCase:
def __init__(self):
self.numPassed = 0
self.numFailed = 0
self.assertPassed = 0
self.assertFailed = 0
self.verbosity = 1
self.tlist = []... | 34 | 96 | 0.531665 | __author__ = 'bmiller'
class TestCase:
def __init__(self):
self.numPassed = 0
self.numFailed = 0
self.assertPassed = 0
self.assertFailed = 0
self.verbosity = 1
self.tlist = []
testNames = {}
for name in dir(self):
if name[:4] == 'test' and... | true | true |
1c019aef38faf246660292b9ce636b3070c322ce | 1,417 | py | Python | python-oo-practice/serial.py | MostFunGuy/SpringboardProjectsPublic | bbda3ba26ecf8a09e62df81583122cae83acc1e6 | [
"MIT"
] | null | null | null | python-oo-practice/serial.py | MostFunGuy/SpringboardProjectsPublic | bbda3ba26ecf8a09e62df81583122cae83acc1e6 | [
"MIT"
] | null | null | null | python-oo-practice/serial.py | MostFunGuy/SpringboardProjectsPublic | bbda3ba26ecf8a09e62df81583122cae83acc1e6 | [
"MIT"
] | null | null | null | """Python serial number generator."""
class SerialGenerator:
"""Machine to create unique incrementing serial numbers.
>>> serial = SerialGenerator(start=100)
>>> serial.generate()
100
>>> serial.generate()
101
>>> serial.generate()
102
>>> serial.reset()
>>> serial.generate()
... | 35.425 | 107 | 0.642202 |
class SerialGenerator:
def __init__(self, start=0): self.start = start self.current = start self.reset()
def reset(self): self.current = self.start self.next = self.current + 1
def generate(self):
self.next = self.next + 1 return self.next - 1
... | true | true |
1c019bb4a630a39cc784ab5c2d6cc10535ba4968 | 4,010 | py | Python | DerPi/derpapi.py | iTecAI/DerPi | 854df7b24a431b75f17af829483fe714f33b6c02 | [
"MIT"
] | null | null | null | DerPi/derpapi.py | iTecAI/DerPi | 854df7b24a431b75f17af829483fe714f33b6c02 | [
"MIT"
] | null | null | null | DerPi/derpapi.py | iTecAI/DerPi | 854df7b24a431b75f17af829483fe714f33b6c02 | [
"MIT"
] | null | null | null | import time, os
from ascii_func import ctrl
try:
import serial
except:
import pyserial as serial
try:
uart = serial.Serial('/dev/serial0', 115200, timeout=0.5)
except:
print('Raspi not detected. Please install on raspberry pi to gain access to serial commands')
uart = open('fake_serial... | 27.278912 | 135 | 0.480299 | import time, os
from ascii_func import ctrl
try:
import serial
except:
import pyserial as serial
try:
uart = serial.Serial('/dev/serial0', 115200, timeout=0.5)
except:
print('Raspi not detected. Please install on raspberry pi to gain access to serial commands')
uart = open('fake_serial... | true | true |
1c019d69318681bc2819cea7dba091c87e119e14 | 5,163 | py | Python | synapse/lib/atomfile.py | vertexmc/synapse | bd1f8ab1abcbaac20dc9afb9ad385cf831278ada | [
"Apache-2.0"
] | null | null | null | synapse/lib/atomfile.py | vertexmc/synapse | bd1f8ab1abcbaac20dc9afb9ad385cf831278ada | [
"Apache-2.0"
] | 4 | 2017-10-03T21:50:40.000Z | 2017-11-20T15:49:38.000Z | synapse/lib/atomfile.py | vertexmc/synapse | bd1f8ab1abcbaac20dc9afb9ad385cf831278ada | [
"Apache-2.0"
] | null | null | null | import os
import mmap
import logging
import threading
import synapse.common as s_common
import synapse.eventbus as s_eventbus
import synapse.lib.const as s_const
logger = logging.getLogger(__name__)
class AtomBase(s_eventbus.EventBus):
def __init__(self):
s_eventbus.EventBus.__init__(self)
sel... | 21.877119 | 84 | 0.552973 | import os
import mmap
import logging
import threading
import synapse.common as s_common
import synapse.eventbus as s_eventbus
import synapse.lib.const as s_const
logger = logging.getLogger(__name__)
class AtomBase(s_eventbus.EventBus):
def __init__(self):
s_eventbus.EventBus.__init__(self)
sel... | true | true |
1c019d78f19b415a6b3feed4628fc5bcff6557d2 | 788 | py | Python | profiles_api/migrations/0002_profilefeeditem.py | Hadraniel/profiles-rest-api | 2e197359a5c711a825518410106130d89f251719 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | Hadraniel/profiles-rest-api | 2e197359a5c711a825518410106130d89f251719 | [
"MIT"
] | 4 | 2021-03-19T08:46:28.000Z | 2022-02-10T13:52:40.000Z | profiles_api/migrations/0002_profilefeeditem.py | Hadraniel/profiles-rest-api | 2e197359a5c711a825518410106130d89f251719 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-02-28 09:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.52 | 126 | 0.633249 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ProfileFeedItem',
f... | true | true |
1c019e6135afcdb4a0b42b3ccb6d66ccd5277352 | 875 | py | Python | repos/system_upgrade/common/actors/scanpkgmanager/libraries/scanpkgmanager.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 21 | 2018-11-20T15:58:39.000Z | 2022-03-15T19:57:24.000Z | repos/system_upgrade/common/actors/scanpkgmanager/libraries/scanpkgmanager.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 732 | 2018-11-21T18:33:26.000Z | 2022-03-31T16:16:24.000Z | repos/system_upgrade/common/actors/scanpkgmanager/libraries/scanpkgmanager.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 85 | 2018-11-20T17:55:00.000Z | 2022-03-29T09:40:31.000Z | import os
from leapp.libraries.stdlib import api
from leapp.models import PkgManagerInfo
from leapp.libraries.common.config.version import get_source_major_version
def _get_releasever_path():
default_manager = 'yum' if get_source_major_version() == '7' else 'dnf'
return '/etc/{}/vars/releasever'.format(defau... | 26.515152 | 75 | 0.737143 | import os
from leapp.libraries.stdlib import api
from leapp.models import PkgManagerInfo
from leapp.libraries.common.config.version import get_source_major_version
def _get_releasever_path():
default_manager = 'yum' if get_source_major_version() == '7' else 'dnf'
return '/etc/{}/vars/releasever'.format(defau... | true | true |
1c019ef3c17002ba5ef0d670a7cbfc785dabdf3f | 93 | py | Python | utils/enums.py | repl-it-discord/HootHoot | 80c4cb158e476a26d49ba9aa4b6d4dc93576786f | [
"MIT"
] | 9 | 2019-08-02T15:54:42.000Z | 2020-12-08T01:55:05.000Z | utils/enums.py | replit-discord/HootHoot | 80c4cb158e476a26d49ba9aa4b6d4dc93576786f | [
"MIT"
] | 3 | 2019-07-28T01:13:57.000Z | 2020-05-16T14:03:23.000Z | utils/enums.py | repl-it-discord/HootHoot | 80c4cb158e476a26d49ba9aa4b6d4dc93576786f | [
"MIT"
] | 6 | 2019-09-10T12:03:30.000Z | 2020-11-20T20:23:21.000Z | from enum import Enum
class Status(Enum):
ENABLED = 0
WARNING = 1
DISABLED = 2
| 11.625 | 21 | 0.623656 | from enum import Enum
class Status(Enum):
ENABLED = 0
WARNING = 1
DISABLED = 2
| true | true |
1c019fa08a312a6b19f33de42002259207f78f8e | 887 | py | Python | mqtt-pub.py | Fernanda-Dev21/aulasiot | 510d0f2a95e746d60cb1ebf417ae6ad9dcb15cb2 | [
"BSD-2-Clause"
] | 1 | 2021-09-30T21:18:34.000Z | 2021-09-30T21:18:34.000Z | mqtt-pub.py | Fernanda-Dev21/aulasiot | 510d0f2a95e746d60cb1ebf417ae6ad9dcb15cb2 | [
"BSD-2-Clause"
] | null | null | null | mqtt-pub.py | Fernanda-Dev21/aulasiot | 510d0f2a95e746d60cb1ebf417ae6ad9dcb15cb2 | [
"BSD-2-Clause"
] | null | null | null | import paho.mqtt.client as mqtt
BROKER = "localhost"
PORT = 1883
client = mqtt.Client('pub-py')
client.connect(BROKER, PORT)
def on_publish_callback(client, userdata, result):
print("Dado publicado")
client.on_publish = on_publish_callback
status = "false"
while(True):
value = input('Digite 1 para ligado ... | 23.342105 | 84 | 0.585118 | import paho.mqtt.client as mqtt
BROKER = "localhost"
PORT = 1883
client = mqtt.Client('pub-py')
client.connect(BROKER, PORT)
def on_publish_callback(client, userdata, result):
print("Dado publicado")
client.on_publish = on_publish_callback
status = "false"
while(True):
value = input('Digite 1 para ligado ... | true | true |
1c019fc1661d0f386cf921394132c1f3cbadb591 | 11,575 | py | Python | lib/dataset/CrowdPoseDataset.py | Unifall/DEKR | 3f410bcab420166b030508efd6c71a027c66d5b5 | [
"MIT"
] | null | null | null | lib/dataset/CrowdPoseDataset.py | Unifall/DEKR | 3f410bcab420166b030508efd6c71a027c66d5b5 | [
"MIT"
] | null | null | null | lib/dataset/CrowdPoseDataset.py | Unifall/DEKR | 3f410bcab420166b030508efd6c71a027c66d5b5 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# The code is based on HigherHRNet-Human-Pose-Estimation.
# (https://github.com/HRNet/HigherHRNet-Human-Pose-Estimation)
# Modified by Zigang Geng (zigang@mail.ustc.edu.cn).
# ---... | 34.969789 | 93 | 0.533996 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
from collections import OrderedDict
import logging
import os
import os.path
import cv2
import json_tricks as json
import numpy as np
from torch.utils.data import Dataset
f... | true | true |
1c019ff2af995d18b45cb2433382ad0ba1a7a29a | 571 | py | Python | wallet/dispatcher.py | dasenlinCode/web-wallet | c005dcf786f78e4699bba75874bc1bf1cd290b9d | [
"MIT"
] | null | null | null | wallet/dispatcher.py | dasenlinCode/web-wallet | c005dcf786f78e4699bba75874bc1bf1cd290b9d | [
"MIT"
] | null | null | null | wallet/dispatcher.py | dasenlinCode/web-wallet | c005dcf786f78e4699bba75874bc1bf1cd290b9d | [
"MIT"
] | null | null | null | """
# middleware for dispatch url
"""
from django.shortcuts import render_to_response
from django.http import HttpResponse
class CrossDomainAccess(object):
def process_response(self, request, response):
origin = request.META.get('HTTP_ORIGIN')
if origin:
response["Access-Control-Allo... | 28.55 | 78 | 0.672504 |
from django.shortcuts import render_to_response
from django.http import HttpResponse
class CrossDomainAccess(object):
def process_response(self, request, response):
origin = request.META.get('HTTP_ORIGIN')
if origin:
response["Access-Control-Allow-Origin"] = origin
re... | true | true |
1c01a16ccdfcc3f66b2315fb0fdf0d8217b788ce | 16,234 | py | Python | onecodex/viz/_distance.py | jairideout/onecodex | 905d533376b808a0b2ea74c2e9c5ea1e87754a81 | [
"MIT"
] | null | null | null | onecodex/viz/_distance.py | jairideout/onecodex | 905d533376b808a0b2ea74c2e9c5ea1e87754a81 | [
"MIT"
] | null | null | null | onecodex/viz/_distance.py | jairideout/onecodex | 905d533376b808a0b2ea74c2e9c5ea1e87754a81 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from itertools import chain
import warnings
from onecodex.exceptions import OneCodexException
from onecodex.distance import DistanceMixin
class VizDistanceMixin(DistanceMixin):
def _compute_distance(self, rank, metric):
if rank is None:
raise OneCodexException("Please ... | 42.276042 | 102 | 0.609215 | from itertools import chain
import warnings
from onecodex.exceptions import OneCodexException
from onecodex.distance import DistanceMixin
class VizDistanceMixin(DistanceMixin):
def _compute_distance(self, rank, metric):
if rank is None:
raise OneCodexException("Please specify a rank or 'auto'... | true | true |
1c01a38e0cf355caad2ab78db8ebc0fa0d3c2ff2 | 1,401 | py | Python | tiledb/__init__.py | umvarma/TileDB-Py | 17419cc9a882ce8644e2c50b584ffa417be5844b | [
"MIT"
] | null | null | null | tiledb/__init__.py | umvarma/TileDB-Py | 17419cc9a882ce8644e2c50b584ffa417be5844b | [
"MIT"
] | null | null | null | tiledb/__init__.py | umvarma/TileDB-Py | 17419cc9a882ce8644e2c50b584ffa417be5844b | [
"MIT"
] | 1 | 2018-11-30T05:08:48.000Z | 2018-11-30T05:08:48.000Z | from __future__ import absolute_import
import ctypes
import os
import sys
if os.name == "posix":
if sys.platform == "darwin":
lib_name = "libtiledb.dylib"
else:
lib_name = "libtiledb.so"
elif os.name == "nt":
lib_name = "tiledb.dll"
else:
raise Exception("Unsupported os " + os.name)
# Load... | 21.227273 | 104 | 0.646681 | from __future__ import absolute_import
import ctypes
import os
import sys
if os.name == "posix":
if sys.platform == "darwin":
lib_name = "libtiledb.dylib"
else:
lib_name = "libtiledb.so"
elif os.name == "nt":
lib_name = "tiledb.dll"
else:
raise Exception("Unsupported os " + os.name)
try:
... | true | true |
1c01a3b6f7ec5b92d789ac713065c333e7089077 | 438 | py | Python | setup.py | shitalmule04/factorial | b5c002f68c49e740cc533613a79ff9a41364fdc9 | [
"MIT"
] | null | null | null | setup.py | shitalmule04/factorial | b5c002f68c49e740cc533613a79ff9a41364fdc9 | [
"MIT"
] | null | null | null | setup.py | shitalmule04/factorial | b5c002f68c49e740cc533613a79ff9a41364fdc9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Factorial project"""
from setuptools import find_packages, setup
setup(name = 'factorial',
version = '0.1',
description = "Factorial module.",
long_description = "A test module from PYM book.",
platforms = ["Linux"],
author="Shital Mule",
author_email="shitalmule04@gmai... | 27.375 | 54 | 0.664384 | from setuptools import find_packages, setup
setup(name = 'factorial',
version = '0.1',
description = "Factorial module.",
long_description = "A test module from PYM book.",
platforms = ["Linux"],
author="Shital Mule",
author_email="shitalmule04@gmail.com",
url="https://github.com/shitalmule... | true | true |
1c01a4a27960702183783c749bb7f5b62475fce1 | 1,819 | py | Python | build_submit.py | vilmar-hillow/kaggle_tgs_salt | 8e4db82b08abbf44ed803a0800402ae48dc7ff86 | [
"MIT"
] | null | null | null | build_submit.py | vilmar-hillow/kaggle_tgs_salt | 8e4db82b08abbf44ed803a0800402ae48dc7ff86 | [
"MIT"
] | null | null | null | build_submit.py | vilmar-hillow/kaggle_tgs_salt | 8e4db82b08abbf44ed803a0800402ae48dc7ff86 | [
"MIT"
] | null | null | null | from pathlib import Path
import cv2
import numpy as np
import pandas as pd
pred_folder = Path('./predictions/')
def RLenc(img, order='F', format=True):
"""
img is binary mask image, shape (r,c)
order is down-then-right, i.e. Fortran
format determines if the order needs to be preformatted (according ... | 23.934211 | 98 | 0.556899 | from pathlib import Path
import cv2
import numpy as np
import pandas as pd
pred_folder = Path('./predictions/')
def RLenc(img, order='F', format=True):
bytes = img.reshape(img.shape[0] * img.shape[1], order=order)
runs = [] r = 0 pos = 1 for c in bytes:
if c == 0:
if r != ... | true | true |
1c01a6d9346bd7341cc4aada0d2d83e637f88e39 | 74 | py | Python | wsgi.py | lanandra/bmi-calculator | afffc6aabcfad8534026e5a22ca1c3d0dbb4ead2 | [
"MIT"
] | null | null | null | wsgi.py | lanandra/bmi-calculator | afffc6aabcfad8534026e5a22ca1c3d0dbb4ead2 | [
"MIT"
] | 10 | 2021-07-27T14:29:18.000Z | 2021-07-30T20:50:07.000Z | wsgi.py | haripandu/BMI-Application | 7373d95a3163f4c95da5e95356692565161b707b | [
"MIT"
] | 1 | 2021-09-21T00:07:55.000Z | 2021-09-21T00:07:55.000Z | # wsgi.py
from main import app
if __name__ == "__main__":
app.run()
| 10.571429 | 26 | 0.635135 |
from main import app
if __name__ == "__main__":
app.run()
| true | true |
1c01a7786013960e70c80c6c5147ac12a2cba3e6 | 2,064 | py | Python | tests/test_electricity.py | romainsacchi/premise | e9ba6d60cf94b63b522c45e24ab70ce9cf5557c2 | [
"BSD-3-Clause"
] | 23 | 2021-01-27T12:40:10.000Z | 2022-02-24T03:08:28.000Z | tests/test_electricity.py | yuzhangnju/premise | e9874a45f00420f41a066641bca56a78fc515779 | [
"BSD-3-Clause"
] | 28 | 2021-01-05T16:27:31.000Z | 2022-02-17T08:11:50.000Z | tests/test_electricity.py | yuzhangnju/premise | e9874a45f00420f41a066641bca56a78fc515779 | [
"BSD-3-Clause"
] | 13 | 2021-03-05T09:59:41.000Z | 2022-02-21T21:37:15.000Z | # content of test_electricity.py
import os
from premise import DATA_DIR
from premise.data_collection import IAMDataCollection
from premise.electricity import Electricity
REGION_MAPPING_FILEPATH = DATA_DIR / "regionmappingH12.csv"
PRODUCTION_PER_TECH = (
DATA_DIR / "electricity" / "electricity_production_volumes_p... | 27.52 | 85 | 0.55814 | import os
from premise import DATA_DIR
from premise.data_collection import IAMDataCollection
from premise.electricity import Electricity
REGION_MAPPING_FILEPATH = DATA_DIR / "regionmappingH12.csv"
PRODUCTION_PER_TECH = (
DATA_DIR / "electricity" / "electricity_production_volumes_per_tech.csv"
)
LOSS_PER_COUNTRY =... | true | true |
1c01a7e7a3283fa1820496633c7c6655553cf934 | 18,333 | py | Python | desktop/core/ext-py/django-openid-auth-0.14/django_openid_auth/auth.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/django-openid-auth-0.14/django_openid_auth/auth.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/django-openid-auth-0.14/django_openid_auth/auth.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2008-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above ... | 42.144828 | 79 | 0.644303 |
from __future__ import unicode_literals
import re
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core.exceptions import ImproperlyConfigured
from openid.consumer.consumer import SUCCESS
from openid.extensions impor... | true | true |
1c01a89bac6beafa4575166ab3aa219bf4b1d7f7 | 9,093 | py | Python | P1_Sudoku/new_test.py | YouYueHuang/Artificial_intelligence_ND | e4789848263aad5258a38162fc62bd3783ad5454 | [
"MIT"
] | null | null | null | P1_Sudoku/new_test.py | YouYueHuang/Artificial_intelligence_ND | e4789848263aad5258a38162fc62bd3783ad5454 | [
"MIT"
] | null | null | null | P1_Sudoku/new_test.py | YouYueHuang/Artificial_intelligence_ND | e4789848263aad5258a38162fc62bd3783ad5454 | [
"MIT"
] | null | null | null | # encoding the board
rows = 'ABCDEFGHI'
cols = '123456789'
# helper function to form a list of all the possible concatenations of a letter s in
# string a with a letter t in string b.
def cross(a, b):
return [s+t for s in a for t in b]
# create the labels of all the boxes
boxes = cross(rows, cols)
# construct a ... | 38.858974 | 115 | 0.633344 | rows = 'ABCDEFGHI'
cols = '123456789'
def cross(a, b):
return [s+t for s in a for t in b]
boxes = cross(rows, cols)
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC', 'DEF', 'GHI') for cs in ('123', '456', '789')]
diag_units = ... | true | true |
1c01a98acd67f4647a439291dc9aebaec5f2cab5 | 508 | py | Python | Ago-Dic-2019/NoemiEstherFloresPardo/ExamenSegundoParcial/Ejercicio1/arttista.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2019/NoemiEstherFloresPardo/ExamenSegundoParcial/Ejercicio1/arttista.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2019/NoemiEstherFloresPardo/ExamenSegundoParcial/Ejercicio1/arttista.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | class artista(object):
def __init__(self, **args):
self._id = args.get('id')
self._area = args.get('area')
self._typeC = args.get('typeC')
self._nombre = args.get('nombre')
self._sort = args.get('sort')
self._idd = args.get('idd')
self._extScore = args.get('ex... | 42.333333 | 155 | 0.584646 | class artista(object):
def __init__(self, **args):
self._id = args.get('id')
self._area = args.get('area')
self._typeC = args.get('typeC')
self._nombre = args.get('nombre')
self._sort = args.get('sort')
self._idd = args.get('idd')
self._extScore = args.get('ex... | true | true |
1c01aabd6521cbcef6dcb6e33e6fa31821117645 | 464 | py | Python | scripts/astf/gtpu_topo.py | leyirong/trex-core | c57cce2a2a5981625fb3ca02208119dc7cb34aa8 | [
"Apache-2.0"
] | null | null | null | scripts/astf/gtpu_topo.py | leyirong/trex-core | c57cce2a2a5981625fb3ca02208119dc7cb34aa8 | [
"Apache-2.0"
] | null | null | null | scripts/astf/gtpu_topo.py | leyirong/trex-core | c57cce2a2a5981625fb3ca02208119dc7cb34aa8 | [
"Apache-2.0"
] | null | null | null | # Example of Topology profile
from trex.astf.api import *
from trex.astf.tunnels_topo import TunnelsTopo
def get_topo():
topo = TunnelsTopo()
topo.add_tunnel_ctx(
src_start = '16.0.0.0',
src_end = '16.0.0.255',
initial_teid = 0,
teid_jump = 1,
sport = 5000,
... | 17.846154 | 46 | 0.547414 |
from trex.astf.api import *
from trex.astf.tunnels_topo import TunnelsTopo
def get_topo():
topo = TunnelsTopo()
topo.add_tunnel_ctx(
src_start = '16.0.0.0',
src_end = '16.0.0.255',
initial_teid = 0,
teid_jump = 1,
sport = 5000,
version = 4,
tunnel_ty... | true | true |
1c01ab3ad4390514b1ff67db47757956ad71c444 | 955 | py | Python | gcp_airflow_foundations/operators/gcp/delete_staging_table.py | badal-io/gcp-airflow-foundations | 7b8cb2bb487c85a382b7381e4ff9824018e4cc1e | [
"Apache-2.0"
] | 3 | 2021-11-11T23:16:19.000Z | 2022-03-23T21:53:50.000Z | gcp_airflow_foundations/operators/gcp/delete_staging_table.py | badal-io/gcp-airflow-foundations | 7b8cb2bb487c85a382b7381e4ff9824018e4cc1e | [
"Apache-2.0"
] | 9 | 2021-10-18T20:32:58.000Z | 2022-03-30T22:08:59.000Z | gcp_airflow_foundations/operators/gcp/delete_staging_table.py | badal-io/gcp-airflow-foundations | 7b8cb2bb487c85a382b7381e4ff9824018e4cc1e | [
"Apache-2.0"
] | 1 | 2022-03-23T21:53:53.000Z | 2022-03-23T21:53:53.000Z | from typing import Optional
from airflow.providers.google.cloud.operators.bigquery import (
BigQueryDeleteTableOperator,
)
from airflow.utils.decorators import apply_defaults
from airflow.exceptions import AirflowException
import logging
class BigQueryDeleteStagingTableOperator(BigQueryDeleteTableOperator):
... | 25.810811 | 75 | 0.682723 | from typing import Optional
from airflow.providers.google.cloud.operators.bigquery import (
BigQueryDeleteTableOperator,
)
from airflow.utils.decorators import apply_defaults
from airflow.exceptions import AirflowException
import logging
class BigQueryDeleteStagingTableOperator(BigQueryDeleteTableOperator):
... | true | true |
1c01ab4a78f4797d1217ebdfe82b16d3b484c505 | 8,682 | py | Python | sdk/python/pulumi_azure_native/web/v20180201/web_app_source_control.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20180201/web_app_source_control.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20180201/web_app_source_control.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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
from ... import _utilities, _tables
__a... | 49.050847 | 1,367 | 0.667127 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['WebAppSourceControl']
class WebAppSourceControl(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts... | true | true |
1c01ab895a73fd1a445be157970b893d20d57af9 | 1,576 | py | Python | src/OTLMOW/Facility/SettingsManager.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/Facility/SettingsManager.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/Facility/SettingsManager.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | import json
from OTLMOW.Facility.DotnotatieHelper import DotnotatieHelper
from OTLMOW.Facility.Singleton import Singleton
class SettingsManager(metaclass=Singleton):
def __init__(self, settings_path: str = ''):
self.settings: dict = {}
if settings_path != '':
self.load_settings_from_f... | 50.83871 | 123 | 0.678934 | import json
from OTLMOW.Facility.DotnotatieHelper import DotnotatieHelper
from OTLMOW.Facility.Singleton import Singleton
class SettingsManager(metaclass=Singleton):
def __init__(self, settings_path: str = ''):
self.settings: dict = {}
if settings_path != '':
self.load_settings_from_f... | true | true |
1c01abedfb479893398d644f4abe20f6baee042e | 15,250 | py | Python | src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py | staer/azure-cli | 93c47df7565a6ff1bca080bd68be2a8252545def | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py | staer/azure-cli | 93c47df7565a6ff1bca080bd68be2a8252545def | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py | staer/azure-cli | 93c47df7565a6ff1bca080bd68be2a8252545def | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 50.496689 | 135 | 0.596984 |
import json
import os
import tempfile
import time
import datetime
from unittest import mock
import unittest
from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only
from azure.cli.core.profiles import ResourceType, get_sdk
from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroup... | true | true |
1c01ad0559d4ed6368445713114fde6e1ef9715b | 530 | py | Python | env_windows/Lib/site-packages/tqdm/_utils.py | domrachr/d1_hw | 581774bd5a8a8e40c6c8d079bf07762f34e5dca9 | [
"MIT"
] | 1 | 2019-11-12T23:28:21.000Z | 2019-11-12T23:28:21.000Z | tqdm/_utils.py | wqsemc/tqdm | 91494ccf363e5eeb4745db7dbab70ef73c4a6eb0 | [
"MIT"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | tqdm/_utils.py | wqsemc/tqdm | 91494ccf363e5eeb4745db7dbab70ef73c4a6eb0 | [
"MIT"
] | 1 | 2021-05-04T09:18:22.000Z | 2021-05-04T09:18:22.000Z | from .utils import CUR_OS, IS_WIN, IS_NIX, RE_ANSI, _range, _unich, _unicode, colorama, WeakSet, _basestring, _OrderedDict, FormatReplace, Comparable, SimpleTextIOWrapper, _is_utf, _supports_unicode, _is_ascii, _environ_cols_wrapper, _environ_cols_windows, _environ_cols_tput, _environ_cols_linux, _term_move_up # NOQA
... | 75.714286 | 319 | 0.8 | from .utils import CUR_OS, IS_WIN, IS_NIX, RE_ANSI, _range, _unich, _unicode, colorama, WeakSet, _basestring, _OrderedDict, FormatReplace, Comparable, SimpleTextIOWrapper, _is_utf, _supports_unicode, _is_ascii, _environ_cols_wrapper, _environ_cols_windows, _environ_cols_tput, _environ_cols_linux, _term_move_up from .s... | true | true |
1c01aea262a4a5a131536cf056b9ea572833e98a | 2,432 | py | Python | Section 3/3.2.py | PacktPublishing/-Introduction-to-Bayesian-Analysis-in-Python | e0ab762a6cd4423b59d0dbf22e8224028b88c29d | [
"MIT"
] | 4 | 2019-03-15T12:44:29.000Z | 2022-01-30T12:39:21.000Z | Section 3/3.2.py | PacktPublishing/-Introduction-to-Bayesian-Analysis-in-Python | e0ab762a6cd4423b59d0dbf22e8224028b88c29d | [
"MIT"
] | null | null | null | Section 3/3.2.py | PacktPublishing/-Introduction-to-Bayesian-Analysis-in-Python | e0ab762a6cd4423b59d0dbf22e8224028b88c29d | [
"MIT"
] | 3 | 2019-07-01T13:32:00.000Z | 2021-03-17T05:34:14.000Z | #!/usr/bin/env python
# coding: utf-8
# In[7]:
get_ipython().run_line_magic('matplotlib', 'inline')
import scipy.stats as stats
from IPython.core.pylabtools import figsize
import numpy as np
import matplotlib.pyplot as plt
figsize(12.5, 9)
norm_pdf = stats.norm.pdf
plt.subplot(311)
x = np.linspace(0, 60000, 200)
... | 27.022222 | 111 | 0.629934 |
get_ipython().run_line_magic('matplotlib', 'inline')
import scipy.stats as stats
from IPython.core.pylabtools import figsize
import numpy as np
import matplotlib.pyplot as plt
figsize(12.5, 9)
norm_pdf = stats.norm.pdf
plt.subplot(311)
x = np.linspace(0, 60000, 200)
sp1 = plt.fill_between(x , 0, norm_pdf(x, 35000... | true | true |
1c01af93b914fbb544f6ea537c0076d2e425d54b | 23,628 | py | Python | tests/test_octodns_manager.py | jereques/octodns | e17e30b3837e149677e36ad234e91037c373ea0b | [
"MIT"
] | null | null | null | tests/test_octodns_manager.py | jereques/octodns | e17e30b3837e149677e36ad234e91037c373ea0b | [
"MIT"
] | null | null | null | tests/test_octodns_manager.py | jereques/octodns | e17e30b3837e149677e36ad234e91037c373ea0b | [
"MIT"
] | null | null | null | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from os import environ
from os.path import dirname, join
from octodns import __VERSION__
from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, \
ManagerException
from octodns.processor.base import ... | 40.597938 | 79 | 0.59967 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from os import environ
from os.path import dirname, join
from octodns import __VERSION__
from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, \
ManagerException
from octodns.processor.base import BasePr... | true | true |
1c01b14a53549aee9eea9c6f3d8d6c71a8b94cc8 | 75,012 | py | Python | proganomaly_modules/beam_image_stitch/components/inference.py | ryangillard/P-CEAD | d4e95fa17112af07eb99cd581470bd3146d1c8e5 | [
"Apache-2.0"
] | 6 | 2021-07-01T23:37:10.000Z | 2022-02-19T03:12:41.000Z | proganomaly_modules/beam_image_stitch/components/inference.py | ryangillard/P-CEAD | d4e95fa17112af07eb99cd581470bd3146d1c8e5 | [
"Apache-2.0"
] | null | null | null | proganomaly_modules/beam_image_stitch/components/inference.py | ryangillard/P-CEAD | d4e95fa17112af07eb99cd581470bd3146d1c8e5 | [
"Apache-2.0"
] | 2 | 2021-07-01T23:37:30.000Z | 2021-12-21T18:19:21.000Z | # Copyright 2020 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 40.811752 | 155 | 0.566203 |
import apache_beam as beam
from apache_beam.io.gcp import gcsio
from collections import defaultdict
import cv2
import math
import matplotlib.pyplot as plt
import openslide
import os
import numpy as np
import tensorflow as tf
class InferenceDoFn(beam.DoFn):
def __init__(
self,
wsi_stitch_gcs_path,... | true | true |
1c01b1f3f838011ede7aa62e219265c20169b5fc | 952 | py | Python | stac_fastapi/extensions/stac_fastapi/extensions/core/query.py | AsgerPetersen/stac-fastapi | 27e134589107654920c2f1dba54773c8c85d4e1a | [
"MIT"
] | 1 | 2021-07-08T23:20:42.000Z | 2021-07-08T23:20:42.000Z | stac_fastapi/extensions/stac_fastapi/extensions/core/query.py | nmandery/stac-fastapi | 8cce4fb449d6bdb36a788e959bce6012cd6f83e6 | [
"MIT"
] | 15 | 2022-01-12T08:52:22.000Z | 2022-02-02T14:41:47.000Z | src/stac_fastapi/extensions/stac_fastapi/extensions/core/query.py | Dataforsyningen/skraafoto_stac_public | fa9cb7e3516cfacf730d24bb56ae50e2e0e5bae1 | [
"MIT"
] | null | null | null | """query extension."""
from typing import List, Optional
import attr
from fastapi import FastAPI
from stac_fastapi.types.extension import ApiExtension
@attr.s
class QueryExtension(ApiExtension):
"""Query Extension.
The Query extension adds an additional `query` parameter to `/search` requests which allows ... | 27.2 | 117 | 0.678571 | from typing import List, Optional
import attr
from fastapi import FastAPI
from stac_fastapi.types.extension import ApiExtension
@attr.s
class QueryExtension(ApiExtension):
conformance_classes: List[str] = attr.ib(
factory=lambda: ["https://api.stacspec.org/v1.0.0-beta.3/item-search/#query"]
)
s... | true | true |
1c01b2d22a4a3a9e62aa35a9b3d456fa60ecd9d3 | 11,590 | py | Python | selfdrive/car/toyota/carstate.py | Hikari1023/Openpilot | b2105d76c797982975706147b2fe42ce940341bc | [
"MIT"
] | null | null | null | selfdrive/car/toyota/carstate.py | Hikari1023/Openpilot | b2105d76c797982975706147b2fe42ce940341bc | [
"MIT"
] | null | null | null | selfdrive/car/toyota/carstate.py | Hikari1023/Openpilot | b2105d76c797982975706147b2fe42ce940341bc | [
"MIT"
] | null | null | null | from cereal import car
from common.conversions import Conversions as CV
from common.numpy_fast import mean
from common.filter_simple import FirstOrderFilter
from common.realtime import DT_CTRL
from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from selfdrive.car.interfaces import CarS... | 41.690647 | 133 | 0.668421 | from cereal import car
from common.conversions import Conversions as CV
from common.numpy_fast import mean
from common.filter_simple import FirstOrderFilter
from common.realtime import DT_CTRL
from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from selfdrive.car.interfaces import CarS... | true | true |
1c01b338c9530b3ca0f4438a98f5df9993f16946 | 3,551 | py | Python | backend/backend/settings.py | danialeshete/FoodAdvisor | cbb216f88e97b92e2ed5578e2c7371b3a6732da8 | [
"MIT"
] | 1 | 2022-02-28T14:26:57.000Z | 2022-02-28T14:26:57.000Z | backend/backend/settings.py | danialeshete/FoodAdvisor | cbb216f88e97b92e2ed5578e2c7371b3a6732da8 | [
"MIT"
] | null | null | null | backend/backend/settings.py | danialeshete/FoodAdvisor | cbb216f88e97b92e2ed5578e2c7371b3a6732da8 | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib... | 25.731884 | 91 | 0.692199 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-c3we%xc3x6nrgo_00f%7vpo!$y)pkpq)y81b71ndw7g=q009e-'
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1', '0.0.0.0', 'backend','localhost']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
... | true | true |
1c01b362e9fbc6805ba138da2b948c4a77d8461b | 955 | py | Python | Lib/site-packages/tensorflow_core/_api/v2/sysconfig/__init__.py | caiyongji/py36-tf2.0rc | c5b4b364ba14214534228570e58ef96b1a8bb6dc | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/tensorflow_core/_api/v2/sysconfig/__init__.py | caiyongji/py36-tf2.0rc | c5b4b364ba14214534228570e58ef96b1a8bb6dc | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/tensorflow_core/_api/v2/sysconfig/__init__.py | caiyongji/py36-tf2.0rc | c5b4b364ba14214534228570e58ef96b1a8bb6dc | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""System configuration library.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.framework.versions import CXX11_ABI_FLAG
from tenso... | 38.2 | 82 | 0.834555 |
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.framework.versions import CXX11_ABI_FLAG
from tensorflow.python.framework.versions import MONOLITHIC_BUILD
from tensorflow.python.platform.sysconfig import get_compile_flags
from tensorflow.python.platform.sysconfig im... | true | true |
1c01b4ff3c321e013a3232bf9faf221e8838c402 | 6,838 | py | Python | Exercise-3/sensor_stick/scripts/object_recognition.py | OptimomEngineer/RoboND-Perception-Exercises | e2dd7b91a2cd6376cd18b07d1f03bab06d400718 | [
"MIT"
] | null | null | null | Exercise-3/sensor_stick/scripts/object_recognition.py | OptimomEngineer/RoboND-Perception-Exercises | e2dd7b91a2cd6376cd18b07d1f03bab06d400718 | [
"MIT"
] | null | null | null | Exercise-3/sensor_stick/scripts/object_recognition.py | OptimomEngineer/RoboND-Perception-Exercises | e2dd7b91a2cd6376cd18b07d1f03bab06d400718 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import sklearn
from sklearn.preprocessing import LabelEncoder
import pickle
from sensor_stick.srv import GetNormals
from sensor_stick.features import compute_color_histograms
from sensor_stick.features import compute_normal_histograms
from visualization_msgs.msg import Marker... | 37.36612 | 120 | 0.736326 |
import numpy as np
import sklearn
from sklearn.preprocessing import LabelEncoder
import pickle
from sensor_stick.srv import GetNormals
from sensor_stick.features import compute_color_histograms
from sensor_stick.features import compute_normal_histograms
from visualization_msgs.msg import Marker
from sensor_stick.ma... | false | true |
1c01b6e234bec68b4984529558a545062d186c7e | 11,036 | py | Python | gooey/gui/components/config.py | geosaleh/Gooey | c2aa8afc269271d55f011c6bc89828992a30b3f0 | [
"MIT"
] | 1 | 2022-02-21T05:51:21.000Z | 2022-02-21T05:51:21.000Z | gooey/gui/components/config.py | geosaleh/Gooey | c2aa8afc269271d55f011c6bc89828992a30b3f0 | [
"MIT"
] | 1 | 2021-12-02T07:42:03.000Z | 2021-12-02T07:42:03.000Z | gooey/gui/components/config.py | geosaleh/Gooey | c2aa8afc269271d55f011c6bc89828992a30b3f0 | [
"MIT"
] | null | null | null | from typing import Mapping, List
import wx # type: ignore
from wx.lib.scrolledpanel import ScrolledPanel # type: ignore
from gooey.gui.components.mouse import notifyMouseEvent
from gooey.gui.components.util.wrapped_static_text import AutoWrappedStaticText
from gooey.gui.lang.i18n import _
from gooey.gui.uti... | 39.841155 | 106 | 0.602755 | from typing import Mapping, List
import wx from wx.lib.scrolledpanel import ScrolledPanel
from gooey.gui.components.mouse import notifyMouseEvent
from gooey.gui.components.util.wrapped_static_text import AutoWrappedStaticText
from gooey.gui.lang.i18n import _
from gooey.gui.util import wx_util
from gooey.pyt... | true | true |
1c01b708d3c0fcb35ec4facc925ded1dbcce0c04 | 3,413 | py | Python | mistral/services/actions.py | ISCAS-VDI/mistral-base | 630dd8c2c3f8b939cf91bf4b3bf6bf1d9aa8174b | [
"Apache-2.0"
] | null | null | null | mistral/services/actions.py | ISCAS-VDI/mistral-base | 630dd8c2c3f8b939cf91bf4b3bf6bf1d9aa8174b | [
"Apache-2.0"
] | null | null | null | mistral/services/actions.py | ISCAS-VDI/mistral-base | 630dd8c2c3f8b939cf91bf4b3bf6bf1d9aa8174b | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 - 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 or ag... | 28.441667 | 77 | 0.658365 |
import json
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc
from mistral.workbook import parser as spec_parser
def create_actions(definition, scope='private'):
action_list_spec = spec_parser.get_action_list_spec_from_yaml(definition)
db_actions = []
with db_api.transactio... | true | true |
1c01b96f9c30e2f5f37d56ac5873c5c0583a28b7 | 10,663 | py | Python | topi/python/topi/x86/bitserial_conv2d.py | titikid/tvm | 0cf3765b28d457d2503ec20b551e9a8eadb1491d | [
"Apache-2.0"
] | 1 | 2020-12-30T02:48:44.000Z | 2020-12-30T02:48:44.000Z | topi/python/topi/x86/bitserial_conv2d.py | titikid/tvm | 0cf3765b28d457d2503ec20b551e9a8eadb1491d | [
"Apache-2.0"
] | null | null | null | topi/python/topi/x86/bitserial_conv2d.py | titikid/tvm | 0cf3765b28d457d2503ec20b551e9a8eadb1491d | [
"Apache-2.0"
] | null | null | null | # pylint: disable=invalid-name,unused-variable,invalid-name
"""Bitserial conv2d schedule on x86"""
import tvm
from topi.util import get_const_int
from .. import generic, tag
from ..nn.bitserial_conv2d import bitserial_conv2d, _get_schedule, _get_workload
from ..nn.bitserial_conv2d import SpatialPackNCHW, SpatialPackNHW... | 33.637224 | 96 | 0.588577 | import tvm
from topi.util import get_const_int
from .. import generic, tag
from ..nn.bitserial_conv2d import bitserial_conv2d, _get_schedule, _get_workload
from ..nn.bitserial_conv2d import SpatialPackNCHW, SpatialPackNHWC
from ..nn.bitserial_conv2d import _WORKLOADS, _SCH_TO_DECL_FUNC_QUANT
_QUANTIZED_SCHEDULES_NCHW ... | true | true |
1c01ba099c6be8ca91fdac051e2aa2d8cd6a5492 | 8,122 | py | Python | Project 5/helper.py | ajaybhat/DLND | 014e4973835817c6e727ff164e5253371f28fe07 | [
"Apache-2.0"
] | null | null | null | Project 5/helper.py | ajaybhat/DLND | 014e4973835817c6e727ff164e5253371f28fe07 | [
"Apache-2.0"
] | null | null | null | Project 5/helper.py | ajaybhat/DLND | 014e4973835817c6e727ff164e5253371f28fe07 | [
"Apache-2.0"
] | null | null | null | import math
import os
import hashlib
from urllib.request import urlretrieve
import zipfile
import gzip
import shutil
import numpy as np
from PIL import Image
from tqdm import tqdm
def _read32(bytestream):
"""
Read 32-bit integer from bytesteam
:param bytestream: A bytestream
:return: 32-bit integer
... | 33.841667 | 116 | 0.641714 | import math
import os
import hashlib
from urllib.request import urlretrieve
import zipfile
import gzip
import shutil
import numpy as np
from PIL import Image
from tqdm import tqdm
def _read32(bytestream):
dt = np.dtype(np.uint32).newbyteorder('>')
return np.frombuffer(bytestream.read(4), dtype=dt)[0]
def _... | true | true |
1c01bb82aca018b955adc6c33b16028cfad2a59c | 11,815 | py | Python | python/mediumroast/api/json_server.py | mediumroast/mr_sdk | 55c7a13c5cef73e677297026b41b7ec23855391f | [
"Apache-2.0"
] | 1 | 2021-10-06T02:46:48.000Z | 2021-10-06T02:46:48.000Z | python/mediumroast/api/json_server.py | mediumroast/mr_sdk | 55c7a13c5cef73e677297026b41b7ec23855391f | [
"Apache-2.0"
] | 3 | 2021-10-16T03:34:07.000Z | 2022-02-23T05:10:12.000Z | python/mediumroast/api/json_server.py | mediumroast/mr_sdk | 55c7a13c5cef73e677297026b41b7ec23855391f | [
"Apache-2.0"
] | null | null | null | __version__ = '1.0'
__author__ = "Michael Hay"
__date__ = '2021-August-30'
__copyright__ = "Copyright 2021 mediumroast.io. All rights reserved."
from ..helpers import utilities
import requests
class rest_scaffold:
def __init__(self, credential):
self.CRED=credential
def get_obj(self, endpoint):
... | 32.105978 | 107 | 0.574355 | __version__ = '1.0'
__author__ = "Michael Hay"
__date__ = '2021-August-30'
__copyright__ = "Copyright 2021 mediumroast.io. All rights reserved."
from ..helpers import utilities
import requests
class rest_scaffold:
def __init__(self, credential):
self.CRED=credential
def get_obj(self, endpoint):
... | true | true |
1c01bbbca36677e66fbf74f03ad85225490c9fc3 | 3,054 | py | Python | setup.py | pombredanne/django-fluent-contents | b8a999a8c1e2fe03a591023688e74c9e4b472d5c | [
"Apache-2.0"
] | null | null | null | setup.py | pombredanne/django-fluent-contents | b8a999a8c1e2fe03a591023688e74c9e4b472d5c | [
"Apache-2.0"
] | null | null | null | setup.py | pombredanne/django-fluent-contents | b8a999a8c1e2fe03a591023688e74c9e4b472d5c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
import codecs
import os
import re
import sys
# When creating the sdist, make sure the django.mo file also exists:
if 'sdist' in sys.argv:
try:
os.chdir('fluent_contents')
from django.core.management.commands.comp... | 33.56044 | 132 | 0.63556 | from setuptools import setup, find_packages
from os import path
import codecs
import os
import re
import sys
if 'sdist' in sys.argv:
try:
os.chdir('fluent_contents')
from django.core.management.commands.compilemessages import compile_messages
compile_messages(sys.stderr)
finally:
... | true | true |
1c01bbec097a704e815df07267042e6253b834b4 | 34,035 | py | Python | perf/_system.py | zed/perf | cf096c0c0c955d0aa1c893847fa6393ba4922ada | [
"MIT"
] | null | null | null | perf/_system.py | zed/perf | cf096c0c0c955d0aa1c893847fa6393ba4922ada | [
"MIT"
] | null | null | null | perf/_system.py | zed/perf | cf096c0c0c955d0aa1c893847fa6393ba4922ada | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
import errno
import os.path
import re
import struct
import subprocess
import sys
from perf._cli import display_title
from perf._cpu_utils import (parse_cpu_list,
get_logical_cpu_count, get_isolated_cpus,
... | 31.426593 | 88 | 0.570266 | from __future__ import division, print_function, absolute_import
import errno
import os.path
import re
import struct
import subprocess
import sys
from perf._cli import display_title
from perf._cpu_utils import (parse_cpu_list,
get_logical_cpu_count, get_isolated_cpus,
... | true | true |
1c01bc400249ee4a55004c0c97a9ac70fbb58018 | 1,733 | py | Python | package/spack-r-lava/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-r-lava/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-r-lava/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 42.268293 | 78 | 0.668782 | from spack import *
class RLava(RPackage):
homepage = "https://cran.r-project.org/package=lava"
url = "https://cran.r-project.org/src/contrib/lava_1.4.7.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/lava"
version('1.4.7', '28039248a7039ba9281d172e4dbf9543')
depends_on(... | true | true |
1c01bd2b47fd22c59390244c6d22e4aab65f3d58 | 2,731 | py | Python | CV/5_LinearFilters.py | Tripartito/AugmentedReality | b0a4455bc15ab5a5647b221bd1efa715fe9114cc | [
"MIT"
] | null | null | null | CV/5_LinearFilters.py | Tripartito/AugmentedReality | b0a4455bc15ab5a5647b221bd1efa715fe9114cc | [
"MIT"
] | null | null | null | CV/5_LinearFilters.py | Tripartito/AugmentedReality | b0a4455bc15ab5a5647b221bd1efa715fe9114cc | [
"MIT"
] | null | null | null | # Modules normally used
import numpy as np
import cv2
def CreateFrame(img, krad, color): # Frame (trick to avoid out-of-bounds access)
height, width, depth = img.shape
if color == "white":
frm = np.ones((height + krad * 2, width + krad * 2, depth))
else:
frm = np.zeros((height + k... | 27.31 | 95 | 0.551813 | import numpy as np
import cv2
def CreateFrame(img, krad, color): height, width, depth = img.shape
if color == "white":
frm = np.ones((height + krad * 2, width + krad * 2, depth))
else:
frm = np.zeros((height + krad * 2, width + krad * 2, depth))
frm[krad:-krad, krad:-krad] = ... | true | true |
1c01bd79d9ce92914a2de1fb43b916477c163eca | 8,802 | py | Python | saltred/saltflat.py | Richard-Tarbell/pysalt | 2815d5533c7e60b7042f2bc3cf46cecdd38fc609 | [
"BSD-3-Clause"
] | 12 | 2015-02-22T08:35:04.000Z | 2020-11-12T11:32:34.000Z | saltred/saltflat.py | Richard-Tarbell/pysalt | 2815d5533c7e60b7042f2bc3cf46cecdd38fc609 | [
"BSD-3-Clause"
] | 17 | 2015-02-24T18:40:26.000Z | 2018-06-05T12:52:59.000Z | saltred/saltflat.py | Richard-Tarbell/pysalt | 2815d5533c7e60b7042f2bc3cf46cecdd38fc609 | [
"BSD-3-Clause"
] | 12 | 2015-03-20T14:46:19.000Z | 2021-08-12T18:30:01.000Z | ################################# LICENSE ##################################
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) #
# All rights reserved. #
# #
# Redistribu... | 38.605263 | 131 | 0.547148 |
"""
saltflat is a flatfielding tool for salt images. It reads
in the data, applies a flatfield, and then produces
flat images
Author Version Date
-----------------------------------------------
SM Crawford (SAAO) 1.0 02 Feb 2009
TODO
-----------------------------------------------
U... | false | true |
1c01bef3a119ef6470ee1d6101a18a306d8e8268 | 10,488 | py | Python | channels/documentaristreamingdb.py | sodicarus/channels | d77402f4f460ea6daa66959aa5384aaffbff70b5 | [
"MIT"
] | null | null | null | channels/documentaristreamingdb.py | sodicarus/channels | d77402f4f460ea6daa66959aa5384aaffbff70b5 | [
"MIT"
] | null | null | null | channels/documentaristreamingdb.py | sodicarus/channels | d77402f4f460ea6daa66959aa5384aaffbff70b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# StreamOnDemand Community Edition - Kodi Addon
# ------------------------------------------------------------
# streamondemand.- XBMC Plugin
# Canale documentaristreamingdb
# http://www.mimediacenter.info/foro/viewforum.php?f=36
# ------------------------------------------------------------
imp... | 38 | 142 | 0.522025 | import re
import urlparse
from core import httptools
from platformcode import logger
from core import scrapertools
from core import servertools
from core.item import Item
__channel__ = "documentaristreamingdb"
host = "https://documentari-streaming-da.com/"
def mainlist(item):
logger.info("streamondemand.docume... | true | true |
1c01bf38aeed5a9b75c669bf04975852ba6d654d | 1,589 | py | Python | wasteZero/app.py | Pedram26/WasteZero | 9fbe8e991179cfb6e98f3b2b0321fc13cd38858c | [
"Apache-2.0"
] | 21 | 2017-01-22T17:41:30.000Z | 2022-03-29T07:32:35.000Z | wasteZero/app.py | abhedya28/wasteZero | 9fbe8e991179cfb6e98f3b2b0321fc13cd38858c | [
"Apache-2.0"
] | null | null | null | wasteZero/app.py | abhedya28/wasteZero | 9fbe8e991179cfb6e98f3b2b0321fc13cd38858c | [
"Apache-2.0"
] | 7 | 2017-06-28T06:38:45.000Z | 2020-01-21T04:20:53.000Z | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
from kivy.lang import Builder
import os
Builder.load_string("""
<MyWidget>:
id: my_widget
Button
text: "open"
on_rele... | 24.828125 | 75 | 0.655129 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
from kivy.lang import Builder
import os
Builder.load_string("""
<MyWidget>:
id: my_widget
Button
text: "open"
on_rele... | true | true |
1c01bf45a73520d0eb652eaea1e729e34b4083d0 | 15,859 | py | Python | scionlab/migrations/0001_initial.py | ManuelMeinen/scionlab | 0609327ef166dbe6be23ab4c5d2434f15c3094f4 | [
"Apache-2.0"
] | null | null | null | scionlab/migrations/0001_initial.py | ManuelMeinen/scionlab | 0609327ef166dbe6be23ab4c5d2434f15c3094f4 | [
"Apache-2.0"
] | null | null | null | scionlab/migrations/0001_initial.py | ManuelMeinen/scionlab | 0609327ef166dbe6be23ab4c5d2434f15c3094f4 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2019-05-23 07:06
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import jsonfield.encoder
import jsonfield.fields
import re
import scionlab.models.user
class Migration(mi... | 66.915612 | 383 | 0.61391 |
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import jsonfield.encoder
import jsonfield.fields
import re
import scionlab.models.user
class Migration(migrations.Migration):
initial = True
... | true | true |
1c01bf817099d75b0f30f00178761b414849d944 | 8,302 | py | Python | Quality_Control/dashboard.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | Quality_Control/dashboard.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | Quality_Control/dashboard.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | import os
import glob
import json
import subprocess
import sys
import importlib
from nipype.utils.filemanip import (load_json, save_json, split_filename, fname_presuffix, copyfile)
from nipype.utils.filemanip import loadcrash
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import... | 43.015544 | 144 | 0.604914 | import os
import glob
import json
import subprocess
import sys
import importlib
from nipype.utils.filemanip import (load_json, save_json, split_filename, fname_presuffix, copyfile)
from nipype.utils.filemanip import loadcrash
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import... | true | true |
1c01bf910f3190ec59e838e26b5e09da623500c1 | 198 | py | Python | dist/brukva/tests/__init__.py | procool/mygw | f35b72b5915d314e883dcde45c3c33ff26f173df | [
"BSD-2-Clause"
] | 83 | 2015-01-05T08:16:02.000Z | 2021-11-12T11:42:46.000Z | dist/brukva/tests/__init__.py | procool/mygw | f35b72b5915d314e883dcde45c3c33ff26f173df | [
"BSD-2-Clause"
] | 4 | 2015-02-22T06:17:08.000Z | 2018-03-13T09:06:11.000Z | dist/brukva/tests/__init__.py | procool/mygw | f35b72b5915d314e883dcde45c3c33ff26f173df | [
"BSD-2-Clause"
] | 12 | 2015-01-22T06:03:42.000Z | 2019-02-09T08:52:21.000Z | import unittest
from server_commands import ServerCommandsTestCase
def all_tests():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(ServerCommandsTestCase))
return suite
| 22 | 61 | 0.792929 | import unittest
from server_commands import ServerCommandsTestCase
def all_tests():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(ServerCommandsTestCase))
return suite
| true | true |
1c01bfbb21e708ed4910a07a5e3561bf76609856 | 2,678 | py | Python | ucscsdk/mometa/identpool/IdentpoolDomainGroupQual.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/identpool/IdentpoolDomainGroupQual.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/identpool/IdentpoolDomainGroupQual.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for IdentpoolDomainGroupQual ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class IdentpoolDomainGroupQualConsts():
ALLOW_DESCENDANTS_FALSE = "false"
ALLO... | 50.528302 | 249 | 0.664675 |
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class IdentpoolDomainGroupQualConsts():
ALLOW_DESCENDANTS_FALSE = "false"
ALLOW_DESCENDANTS_NO = "no"
ALLOW_DESCENDANTS_TRUE = "true"
ALLOW_DESCENDANTS_YES = "yes"
... | true | true |
1c01c058af85550b24f5382a877735a5fbf91cfd | 7,949 | py | Python | outso/modules/hr/attendance/attendance.py | ShahzadNaser/outso | c35e6d3e005635d4425d3223b433322de99fb4b6 | [
"MIT"
] | null | null | null | outso/modules/hr/attendance/attendance.py | ShahzadNaser/outso | c35e6d3e005635d4425d3223b433322de99fb4b6 | [
"MIT"
] | null | null | null | outso/modules/hr/attendance/attendance.py | ShahzadNaser/outso | c35e6d3e005635d4425d3223b433322de99fb4b6 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, The Nexperts Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.utils import cint, flt, get_datetime, get_datetime_str
from outso.constants.globals import SHIFT_HOURS
from outso.utils import get_time_diff, get_post_params
from erpnext.hr... | 44.161111 | 285 | 0.645616 |
import frappe
from frappe.utils import cint, flt, get_datetime, get_datetime_str
from outso.constants.globals import SHIFT_HOURS
from outso.utils import get_time_diff, get_post_params
from erpnext.hr.doctype.shift_assignment.shift_assignment import get_actual_start_end_datetime_of_shift
from erpnext.hr.doctype.employe... | true | true |
1c01c05e02f4905d117662d239238730519bc6b5 | 2,124 | py | Python | activity_2.py | YhHoo/Python-ANN | 6d3629f54100c9dee721108352f562cd28a2e5fc | [
"MIT"
] | null | null | null | activity_2.py | YhHoo/Python-ANN | 6d3629f54100c9dee721108352f562cd28a2e5fc | [
"MIT"
] | null | null | null | activity_2.py | YhHoo/Python-ANN | 6d3629f54100c9dee721108352f562cd28a2e5fc | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from activity_1 import Neural_Object
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
temp = [] # to store the weights
# ------------------------------------------
# Load the saved optimized weights from .txt
# --------------------------------------... | 27.584416 | 68 | 0.591808 | import numpy as np
import matplotlib.pyplot as plt
from activity_1 import Neural_Object
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
temp = []
userInput = input("Do you want to recall the saved weights?(y/n): ")
if userInput is "y" or userInput is "Y":
with open("weights.txt", "r") as f:
... | true | true |
1c01c0d0cae5c5a93e509d3a9b29a29508a97921 | 2,615 | py | Python | bug_report_parser/bug_report_parser.py | hideshis/scripts_for_research | f633bdef0f9b959d7b18c8b95f169306eb8bb50d | [
"MIT"
] | null | null | null | bug_report_parser/bug_report_parser.py | hideshis/scripts_for_research | f633bdef0f9b959d7b18c8b95f169306eb8bb50d | [
"MIT"
] | null | null | null | bug_report_parser/bug_report_parser.py | hideshis/scripts_for_research | f633bdef0f9b959d7b18c8b95f169306eb8bb50d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script identifies following info.:
1. bug ID
2. Craetion date of the report
3. last modified date of the bug report
input: Bug report. It is obtained by using Masaki's script.
output: Info. cited above.
"""
import os
import sys
import commands
import... | 34.407895 | 96 | 0.621797 | import os
import sys
import commands
import subprocess
import re
from lxml import html
def extraction(file_name):
html_string = open(file_name).read()
tree = html.fromstring(html_string)
bug_id_html = tree.xpath('//*[@id="changeform"]/div[1]/a/b/text()')
r = re.compile("[0-9]+")
t... | true | true |
1c01c17e901e0f275cf8581b4be869566ac4f993 | 5,597 | py | Python | tests/test_ansimarkup_basic.py | ponponon/loguru | d38ced7539b888e9e9db7495f49f4499b3ee77e1 | [
"MIT"
] | 11,391 | 2018-12-08T17:44:13.000Z | 2022-03-31T17:55:24.000Z | tests/test_ansimarkup_basic.py | ponponon/loguru | d38ced7539b888e9e9db7495f49f4499b3ee77e1 | [
"MIT"
] | 610 | 2018-12-08T18:03:03.000Z | 2022-03-31T22:28:14.000Z | tests/test_ansimarkup_basic.py | ponponon/loguru | d38ced7539b888e9e9db7495f49f4499b3ee77e1 | [
"MIT"
] | 601 | 2018-12-08T17:46:42.000Z | 2022-03-30T04:23:56.000Z | import pytest
from colorama import Back as B
from colorama import Fore as F
from colorama import Style as S
from .conftest import parse
@pytest.mark.parametrize(
"text, expected",
[
("<bold>1</bold>", S.BRIGHT + "1" + S.RESET_ALL),
("<dim>1</dim>", S.DIM + "1" + S.RESET_ALL),
("<norma... | 26.779904 | 98 | 0.487047 | import pytest
from colorama import Back as B
from colorama import Fore as F
from colorama import Style as S
from .conftest import parse
@pytest.mark.parametrize(
"text, expected",
[
("<bold>1</bold>", S.BRIGHT + "1" + S.RESET_ALL),
("<dim>1</dim>", S.DIM + "1" + S.RESET_ALL),
("<norma... | true | true |
1c01c2770341fbc4dc02d04856c6bd9bdeb09e55 | 4,719 | py | Python | freebase/fcl/mktype.py | leerssej/freebase-python | a8a5ebfd56a11f6eb6e5a6e14a5429aa85a49727 | [
"BSD-2-Clause"
] | 1 | 2016-12-08T12:33:36.000Z | 2016-12-08T12:33:36.000Z | freebase/fcl/mktype.py | yuvadm/freebase-python | e1d4ab54c0b0816b87c3f9727100db37288d6818 | [
"BSD-2-Clause"
] | null | null | null | freebase/fcl/mktype.py | yuvadm/freebase-python | e1d4ab54c0b0816b87c3f9727100db37288d6818 | [
"BSD-2-Clause"
] | 2 | 2016-02-29T22:56:16.000Z | 2021-01-08T04:23:45.000Z | # ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribut... | 31.46 | 88 | 0.642297 |
import os, sys, re, time
from cmdutil import *
from fbutil import *
from freebase.schema import create_object, create_type
def cmd_mkobj(fb, id, typeid='/common/topic', name=''):
"""create a new object with a given type -- EXPERIMENTAL
%prog mkobj new_id typeid name
create a new object with type typeid... | false | true |
1c01c2af132beb3511538216430bdf00239264f8 | 12,111 | py | Python | numba/np/ufunc/dufunc.py | yumasheta/numba | a7c121a6631ba576561bcc6e72a4bfe97151fb4d | [
"BSD-2-Clause"
] | null | null | null | numba/np/ufunc/dufunc.py | yumasheta/numba | a7c121a6631ba576561bcc6e72a4bfe97151fb4d | [
"BSD-2-Clause"
] | null | null | null | numba/np/ufunc/dufunc.py | yumasheta/numba | a7c121a6631ba576561bcc6e72a4bfe97151fb4d | [
"BSD-2-Clause"
] | null | null | null | from numba import jit, typeof
from numba.core import types, utils, serialize, sigutils
from numba.core.typing import npydecl
from numba.core.typing.templates import AbstractTemplate, signature
from numba.np.ufunc import _internal
from numba.core.dispatcher import Dispatcher
from numba.parfors import array_analysis
from... | 37.495356 | 80 | 0.611593 | from numba import jit, typeof
from numba.core import types, utils, serialize, sigutils
from numba.core.typing import npydecl
from numba.core.typing.templates import AbstractTemplate, signature
from numba.np.ufunc import _internal
from numba.core.dispatcher import Dispatcher
from numba.parfors import array_analysis
from... | true | true |
1c01c375ed56297931df29a8680166608226e835 | 82 | py | Python | trash/camera copy/type_cam.py | josmejia2401/face_recognition_python | 6155bfcb6e0dcb5cc3441ff3192ecf83fd1dcf1b | [
"MIT"
] | null | null | null | trash/camera copy/type_cam.py | josmejia2401/face_recognition_python | 6155bfcb6e0dcb5cc3441ff3192ecf83fd1dcf1b | [
"MIT"
] | null | null | null | trash/camera copy/type_cam.py | josmejia2401/face_recognition_python | 6155bfcb6e0dcb5cc3441ff3192ecf83fd1dcf1b | [
"MIT"
] | null | null | null | from enum import Enum
class TypeCam(Enum):
NORMAL = 1
MOV = 2
DIFF = 3 | 16.4 | 21 | 0.609756 | from enum import Enum
class TypeCam(Enum):
NORMAL = 1
MOV = 2
DIFF = 3 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.