hexsha
stringlengths
40
40
size
int64
10
805k
ext
stringclasses
6 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
176
max_stars_repo_name
stringlengths
7
114
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
176
max_issues_repo_name
stringlengths
7
114
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
48.5k
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
176
max_forks_repo_name
stringlengths
7
114
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
10
805k
avg_line_length
float64
5.53
11k
max_line_length
int64
10
129k
alphanum_fraction
float64
0.13
0.93
content_no_comment
stringlengths
0
449k
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f70509cbebb9afd7e84c6f7a0db27094fc3c5d62
1,155
py
Python
bis/apps/gepiandashboard/views/reports.py
AgustinMachiavello/business-incubation-system
983e1308697771570891568f99d1b8ba74441d32
[ "MIT" ]
2
2021-03-03T16:16:42.000Z
2021-03-08T22:43:10.000Z
bis/apps/gepiandashboard/views/reports.py
AgustinMachiavello/business-incubation-system
983e1308697771570891568f99d1b8ba74441d32
[ "MIT" ]
null
null
null
bis/apps/gepiandashboard/views/reports.py
AgustinMachiavello/business-incubation-system
983e1308697771570891568f99d1b8ba74441d32
[ "MIT" ]
null
null
null
"""Reports views""" # Django from django.views.generic import TemplateView # Shortcuts from django.shortcuts import render from django.shortcuts import redirect, reverse, get_object_or_404 from django.contrib.auth import authenticate from django.http import ( HttpResponse, HttpResponseNotFound, HttpRespons...
29.615385
97
0.772294
from django.views.generic import TemplateView from django.shortcuts import render from django.shortcuts import redirect, reverse, get_object_or_404 from django.contrib.auth import authenticate from django.http import ( HttpResponse, HttpResponseNotFound, HttpResponseServerError, HttpResponseRedirect,...
true
true
f7050b4939e82b1488b36ea71d1c8a68281e80ae
1,683
py
Python
test/TestThreadAffinityLibrary.py
srgrr/thread_affinity
56c8a50ea3fed276143a3794b8698d25816ca4a9
[ "Apache-2.0" ]
3
2018-11-30T11:11:34.000Z
2020-08-12T16:48:36.000Z
test/TestThreadAffinityLibrary.py
srgrr/thread_affinity
56c8a50ea3fed276143a3794b8698d25816ca4a9
[ "Apache-2.0" ]
1
2019-09-28T23:08:21.000Z
2019-09-28T23:08:21.000Z
test/TestThreadAffinityLibrary.py
bsc-wdc/thread_affinity
56c8a50ea3fed276143a3794b8698d25816ca4a9
[ "Apache-2.0" ]
null
null
null
import unittest import random import subprocess import signal import sys import os import thread_affinity # Test results may vary if executed in different systems # with different amount of CPUUs def get_random_mask(): """Return a random, valid affinity mask Which is a subset of {0, 1, ..., 2 ** num_procs - 1} ""...
30.6
79
0.758764
import unittest import random import subprocess import signal import sys import os import thread_affinity def get_random_mask(): num_procs = thread_affinity.get_nprocs() r = random.randint(1, 2 ** num_procs) return [i for i in range(num_procs) if (r & (1 << i))] class TestThreadAffinityLibrary(unittest.TestCas...
true
true
f7050b93fb88c44b9196e0bbbdaf73e49e3cfa6c
8,633
py
Python
lib/sqlalchemy/log.py
sqlalchemy-bot/sqlalchemy
c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7
[ "MIT" ]
null
null
null
lib/sqlalchemy/log.py
sqlalchemy-bot/sqlalchemy
c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7
[ "MIT" ]
null
null
null
lib/sqlalchemy/log.py
sqlalchemy-bot/sqlalchemy
c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7
[ "MIT" ]
null
null
null
# sqlalchemy/log.py # Copyright (C) 2006-2022 the SQLAlchemy authors and contributors # <see AUTHORS file> # Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """Logging control ...
29.565068
103
0.654697
from __future__ import annotations import logging import sys from typing import Any from typing import Optional from typing import overload from typing import Set from typing import Type from typing import TypeVar from typing import Union from .util import py311 from .util import py38 from .util.typing import...
true
true
f7050bd0c8ce3ae371a054a6377ad40107a35adf
602
py
Python
repl/InterposedIO.py
freeman-lab/pyrepl
d7312778e1f6d5afddbe51d1ae6f604fcf9fc73f
[ "MIT" ]
9
2018-03-17T01:59:08.000Z
2021-07-30T13:36:46.000Z
repl/InterposedIO.py
chanzuckerberg/pyrepl
c3c366a0c7178a0c00a839b489bfcd0929e220d7
[ "MIT" ]
null
null
null
repl/InterposedIO.py
chanzuckerberg/pyrepl
c3c366a0c7178a0c00a839b489bfcd0929e220d7
[ "MIT" ]
null
null
null
""" Stream IO interposition """ import io class InterposedStringIO(io.StringIO): def __init__(self, newline="\n", line_buffering = False, onflush=None): super().__init__(newline=newline) self._line_buffering = line_buffering self._onflush = onflush def flush(self): ...
25.083333
76
0.571429
import io class InterposedStringIO(io.StringIO): def __init__(self, newline="\n", line_buffering = False, onflush=None): super().__init__(newline=newline) self._line_buffering = line_buffering self._onflush = onflush def flush(self): s = self.getvalue() self...
true
true
f7050c7044587c7a03a7e83f1453f954e296f2ad
49,770
py
Python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
1
2021-09-07T18:39:05.000Z
2021-09-07T18:39:05.000Z
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
null
null
null
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
1
2022-03-04T06:21:56.000Z
2022-03-04T06:21:56.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 may ...
47.445186
361
0.678802
import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_...
true
true
f7050d4c1a884b3f7c432e8139d4cdcd936b354a
7,730
py
Python
airflow/contrib/example_dags/example_twitter_dag.py
suensummit/airflow
37a342d0e96a91ce2d34085e225a4e86f54c4e21
[ "Apache-2.0" ]
1
2021-11-04T20:11:58.000Z
2021-11-04T20:11:58.000Z
airflow/contrib/example_dags/example_twitter_dag.py
suensummit/airflow
37a342d0e96a91ce2d34085e225a4e86f54c4e21
[ "Apache-2.0" ]
20
2017-04-18T19:47:46.000Z
2020-01-13T04:19:24.000Z
airflow/contrib/example_dags/example_twitter_dag.py
suensummit/airflow
37a342d0e96a91ce2d34085e225a4e86f54c4e21
[ "Apache-2.0" ]
2
2018-09-15T07:13:01.000Z
2021-03-26T07:27:38.000Z
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
37.892157
91
0.527167
from datetime import date, timedelta import airflow from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.hive_operator import HiveOperator from airflow.operators.python_operator import PythonOperator def fetchtweets(): def cleantwe...
true
true
f7050dd5698de7872ec97699e5e318cacda83a76
4,510
py
Python
scripts/preprocessing/06-ptp_reject.py
crsegerie/mne-bids-pipeline
897d36eb9e7f626215ad6ac4f645ac18f9477c80
[ "BSD-3-Clause" ]
31
2019-01-30T11:33:23.000Z
2021-02-19T19:30:50.000Z
scripts/preprocessing/06-ptp_reject.py
crsegerie/mne-bids-pipeline
897d36eb9e7f626215ad6ac4f645ac18f9477c80
[ "BSD-3-Clause" ]
207
2019-01-29T16:31:26.000Z
2021-03-26T13:28:26.000Z
scripts/preprocessing/06-ptp_reject.py
crsegerie/mne-bids-pipeline
897d36eb9e7f626215ad6ac4f645ac18f9477c80
[ "BSD-3-Clause" ]
26
2019-01-29T18:05:11.000Z
2021-03-17T08:46:52.000Z
""" ======================================================== 06. Remove epochs based on peak-to-peak (PTP) amplitudes ======================================================== Epochs containing peak-to-peak above the thresholds defined in the 'reject' parameter are removed from the data. This step will drop epochs con...
34.692308
79
0.601774
import itertools import logging from typing import Optional import mne from mne.utils import BunchConst from mne.parallel import parallel_func from mne_bids import BIDSPath import config from config import gen_log_kwargs, on_error, failsafe_run logger = logging.getLogger('mne-bids-pipeline') @failsafe_run(on_erro...
true
true
f7050e55af4a52ddeec20cfc5c797671967bb328
19,712
py
Python
opencell/imaging/images.py
czbiohub/opencell-portal-pub
2b056924e4f55490b16349ff0dcf3e719ab516c7
[ "Unlicense" ]
2
2022-02-17T16:24:49.000Z
2022-03-02T22:26:48.000Z
opencell/imaging/images.py
czbiohub/opencell-portal-pub
2b056924e4f55490b16349ff0dcf3e719ab516c7
[ "Unlicense" ]
null
null
null
opencell/imaging/images.py
czbiohub/opencell-portal-pub
2b056924e4f55490b16349ff0dcf3e719ab516c7
[ "Unlicense" ]
null
null
null
import datetime import hashlib import json import numpy as np import pandas as pd import tifffile def timestamp(): return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') class MicroManagerTIFF: def __init__(self, src_filepath, verbose=True): ''' ''' self.verbose = verbose ...
38.20155
98
0.605976
import datetime import hashlib import json import numpy as np import pandas as pd import tifffile def timestamp(): return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') class MicroManagerTIFF: def __init__(self, src_filepath, verbose=True): self.verbose = verbose self.src_filepath =...
true
true
f7050ebecfade791d4ef5451036aca5787d01b52
3,395
py
Python
venv/venv/Scripts/Mewtify4Windows.py
FullstackAcademy/Mewtify
f6b23a6cf3da3f57bd27256e88786cc8c87e851d
[ "MIT" ]
null
null
null
venv/venv/Scripts/Mewtify4Windows.py
FullstackAcademy/Mewtify
f6b23a6cf3da3f57bd27256e88786cc8c87e851d
[ "MIT" ]
null
null
null
venv/venv/Scripts/Mewtify4Windows.py
FullstackAcademy/Mewtify
f6b23a6cf3da3f57bd27256e88786cc8c87e851d
[ "MIT" ]
1
2021-12-17T01:06:42.000Z
2021-12-17T01:06:42.000Z
#!/usr/bin/env python3 import tkinter as tk import binascii, pyaes, sys, base64, os.path, os from tkinter import * from pathlib import Path from tkinter.font import Font from tkinter.filedialog import askopenfilename import secrets import string def main(): global entry3 input2 = entry3.get() # Open file ...
33.613861
147
0.68218
import tkinter as tk import binascii, pyaes, sys, base64, os.path, os from tkinter import * from pathlib import Path from tkinter.font import Font from tkinter.filedialog import askopenfilename import secrets import string def main(): global entry3 input2 = entry3.get() file_name = malwarename ...
true
true
f7050ec21fb698ea4268b24c71bc79f1318a524a
436,547
py
Python
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_l2vpn_cfg.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_l2vpn_cfg.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_l2vpn_cfg.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
59.957011
406
0.594403
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
true
true
f705108a187baf052d5db4933fed18471b99b3db
11,826
py
Python
utils/crud.py
DaQueenJodi/Kurisu
2a4e9010c862c2dcffb406d3596ed9a115533154
[ "Apache-2.0" ]
null
null
null
utils/crud.py
DaQueenJodi/Kurisu
2a4e9010c862c2dcffb406d3596ed9a115533154
[ "Apache-2.0" ]
null
null
null
utils/crud.py
DaQueenJodi/Kurisu
2a4e9010c862c2dcffb406d3596ed9a115533154
[ "Apache-2.0" ]
null
null
null
from . import models import datetime from discord import utils, TextChannel def generate_id(): return utils.time_snowflake(datetime.datetime.now()) async def add_permanent_role(user_id: int, role_id: int): await add_dbmember_if_not_exist(user_id) if not await models.PermanentRole.query.where((models.Per...
31.876011
154
0.726958
from . import models import datetime from discord import utils, TextChannel def generate_id(): return utils.time_snowflake(datetime.datetime.now()) async def add_permanent_role(user_id: int, role_id: int): await add_dbmember_if_not_exist(user_id) if not await models.PermanentRole.query.where((models.Per...
true
true
f70510cecaf633bc140f5d0280b6040db7788e73
9,585
py
Python
bdd_mtl/mmdet/models/detectors/two_stage.py
XDong18/bdd-mtl
90459c090a2bc4a89a929740e5cf5d37c1b34a4b
[ "BSD-3-Clause" ]
79
2020-04-23T04:39:00.000Z
2022-03-08T09:50:09.000Z
mmdet/models/detectors/two_stage_ori.py
xyldmc/siamese-mask-rcnn_mmdetection
999e5bfcbd3c493bf69b8556c40eb26c9feeb459
[ "Apache-2.0" ]
3
2021-11-04T20:39:52.000Z
2022-03-10T20:29:47.000Z
mmdet/models/detectors/two_stage_ori.py
ducminhkhoi/FAPIS
c89703006a2a5250f4d1c71e0aad958d72526885
[ "Apache-2.0" ]
29
2020-04-23T07:49:15.000Z
2022-03-26T11:48:53.000Z
import torch import torch.nn as nn from .base import BaseDetector from .test_mixins import RPNTestMixin, BBoxTestMixin, MaskTestMixin from .. import builder from ..registry import DETECTORS from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler @DETECTORS.register_module class TwoStageDetector(B...
39.282787
79
0.549609
import torch import torch.nn as nn from .base import BaseDetector from .test_mixins import RPNTestMixin, BBoxTestMixin, MaskTestMixin from .. import builder from ..registry import DETECTORS from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler @DETECTORS.register_module class TwoStageDetector(B...
true
true
f705116959898fd81eae2168f0c9e139ab6337b3
7,603
py
Python
cogs/calculator.py
MerciDvor/modbot
f1a11eaa8e88d297ee19ca37aacc41489c0d0350
[ "MIT" ]
11
2019-01-10T22:09:31.000Z
2021-12-14T05:26:10.000Z
cogs/calculator.py
MerciDvor/modbot
f1a11eaa8e88d297ee19ca37aacc41489c0d0350
[ "MIT" ]
5
2019-01-10T07:20:19.000Z
2021-04-22T00:57:34.000Z
cogs/calculator.py
MerciDvor/modbot
f1a11eaa8e88d297ee19ca37aacc41489c0d0350
[ "MIT" ]
34
2019-01-10T05:49:29.000Z
2022-02-11T14:04:54.000Z
from __future__ import division import discord, math, operator from discord.ext import commands from pyparsing import (Literal,CaselessLiteral,Word,Combine,Group,Optional, ZeroOrMore,Forward,nums,alphas,oneOf) __author__='Paul McGuire' __version__ = '$Revision: 0.0 $' __date__ = '$Date: 2009-03-20...
41.320652
123
0.544916
from __future__ import division import discord, math, operator from discord.ext import commands from pyparsing import (Literal,CaselessLiteral,Word,Combine,Group,Optional, ZeroOrMore,Forward,nums,alphas,oneOf) __author__='Paul McGuire' __version__ = '$Revision: 0.0 $' __date__ = '$Date: 2009-03-20...
true
true
f7051188a962d569b2fe5523b4fb6cc5f81e0849
1,304
py
Python
tests/test_live_photos.py
onfido/onfido-python
e779347f04dd7891987c2c915047fd039f6d7742
[ "MIT" ]
16
2020-06-30T15:35:42.000Z
2022-02-12T09:26:41.000Z
tests/test_live_photos.py
onfido/onfido-python
e779347f04dd7891987c2c915047fd039f6d7742
[ "MIT" ]
6
2020-07-06T08:56:33.000Z
2021-07-12T18:09:07.000Z
tests/test_live_photos.py
onfido/onfido-python
e779347f04dd7891987c2c915047fd039f6d7742
[ "MIT" ]
5
2020-08-18T08:12:19.000Z
2021-05-26T11:43:53.000Z
import onfido from onfido.regions import Region import io api = onfido.Api("<AN_API_TOKEN>", region=Region.EU) fake_uuid = "58a9c6d2-8661-4dbd-96dc-b9b9d344a7ce" def test_upload_photo(requests_mock): mock_upload = requests_mock.post("https://api.eu.onfido.com/v3.2/live_photos/", json=[]) sample_file = open...
37.257143
170
0.751534
import onfido from onfido.regions import Region import io api = onfido.Api("<AN_API_TOKEN>", region=Region.EU) fake_uuid = "58a9c6d2-8661-4dbd-96dc-b9b9d344a7ce" def test_upload_photo(requests_mock): mock_upload = requests_mock.post("https://api.eu.onfido.com/v3.2/live_photos/", json=[]) sample_file = open...
true
true
f705121c1bad013c291364ae04075091589dbba5
1,042
py
Python
_/chapter5-OpenStack/BlockStoreService/VolumeOperations.py
paullewallencom/hybrid-cloud-978-1-7888-3087-4
d101553fd342f420b581b87c58c7219f2b04a7c6
[ "Apache-2.0" ]
3
2018-03-27T14:34:48.000Z
2021-10-04T16:28:19.000Z
_/chapter5-OpenStack/BlockStoreService/VolumeOperations.py
paullewallencom/hybrid-cloud-978-1-7888-3087-4
d101553fd342f420b581b87c58c7219f2b04a7c6
[ "Apache-2.0" ]
null
null
null
_/chapter5-OpenStack/BlockStoreService/VolumeOperations.py
paullewallencom/hybrid-cloud-978-1-7888-3087-4
d101553fd342f420b581b87c58c7219f2b04a7c6
[ "Apache-2.0" ]
1
2021-08-27T23:51:28.000Z
2021-08-27T23:51:28.000Z
#import OpenStack connection class from the SDK from openstack import connection # Create a connection object by calling the constructor and pass the security information conn = connection.Connection(auth_url="http://192.168.0.106/identity", project_name="demo", username="admin", password="manoj", user_domain_id="defa...
29.771429
89
0.779271
from openstack import connection conn = connection.Connection(auth_url="http://192.168.0.106/identity", project_name="demo", username="admin", password="manoj", user_domain_id="default", project_domain_id="default") def create_volume(conn): volume_properties = {'size':'2', 'name':'packtpub-volume-2'} volum...
true
true
f70513caa49442a4e72d71bac1f20f80278b0b7c
107
py
Python
{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py
JDongian/cookiecutter-pypackage
2e7c0d3a623755373560ee68fcb6a162085638c0
[ "Apache-2.0" ]
2
2019-06-12T23:29:41.000Z
2019-06-25T20:35:47.000Z
{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py
JDongian/cookiecutter-pypackage
2e7c0d3a623755373560ee68fcb6a162085638c0
[ "Apache-2.0" ]
4
2018-02-09T06:24:59.000Z
2019-01-23T06:46:11.000Z
{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py
JDongian/cookiecutter-pypackage
2e7c0d3a623755373560ee68fcb6a162085638c0
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """Top-level package for {{ cookiecutter.project_name }}""" __version__ = '0.0.1'
21.4
59
0.616822
__version__ = '0.0.1'
true
true
f70513f071c9fec7e830d9232516ac75706443c6
10
py
Python
example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/tanh Compute hyperbolic tangent element-wise.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
null
null
null
example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/tanh Compute hyperbolic tangent element-wise.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
null
null
null
example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/tanh Compute hyperbolic tangent element-wise.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
1
2021-02-04T04:51:48.000Z
2021-02-04T04:51:48.000Z
np.tanh(x)
10
10
0.7
np.tanh(x)
true
true
f705141e5f48b22c12903c1fa1a907b58b1375d4
366
py
Python
examples/getting_started/06_sentinel.py
emorozov/aioredis
bad0bd2d1435e56688d189cf3209beec3d239557
[ "MIT" ]
null
null
null
examples/getting_started/06_sentinel.py
emorozov/aioredis
bad0bd2d1435e56688d189cf3209beec3d239557
[ "MIT" ]
75
2020-12-09T06:53:47.000Z
2022-03-25T01:05:24.000Z
examples/getting_started/06_sentinel.py
emorozov/aioredis
bad0bd2d1435e56688d189cf3209beec3d239557
[ "MIT" ]
null
null
null
import asyncio import aioredis async def main(): sentinel = await aioredis.create_sentinel( ["redis://localhost:26379", "redis://sentinel2:26379"] ) redis = sentinel.master_for("mymaster") ok = await redis.set("key", "value") assert ok val = await redis.get("key", encoding="utf-8") ...
20.333333
62
0.639344
import asyncio import aioredis async def main(): sentinel = await aioredis.create_sentinel( ["redis://localhost:26379", "redis://sentinel2:26379"] ) redis = sentinel.master_for("mymaster") ok = await redis.set("key", "value") assert ok val = await redis.get("key", encoding="utf-8") ...
true
true
f705170d03d2dd066c58fc27f04b0e6e4b224eb2
1,573
py
Python
app/Resource/ImageResource.py
ansabkhaliq/backend
14bad9b44bfec6ea4ba27d1571ddcf614ff762c6
[ "MIT" ]
null
null
null
app/Resource/ImageResource.py
ansabkhaliq/backend
14bad9b44bfec6ea4ba27d1571ddcf614ff762c6
[ "MIT" ]
11
2020-09-22T11:15:09.000Z
2020-11-03T21:45:18.000Z
app/Resource/ImageResource.py
ansabkhaliq/backend
14bad9b44bfec6ea4ba27d1571ddcf614ff762c6
[ "MIT" ]
2
2020-09-21T19:20:44.000Z
2021-03-21T04:46:19.000Z
import logging from .DatabaseBase import DatabaseBase logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) class ImageResource(DatabaseBase): def __init__(self): super().__init__() def get_product_images_by_id(self, id): search_image_query = """Select * From images w...
34.195652
117
0.633185
import logging from .DatabaseBase import DatabaseBase logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) class ImageResource(DatabaseBase): def __init__(self): super().__init__() def get_product_images_by_id(self, id): search_image_query = """Select * From images w...
true
true
f705181e0f045be38f7e9fa0b37412575523e61a
915
py
Python
weather_api/weather_api/urls.py
brian-duffy/yoyo-test
65700a0061022e326a0048695c122ea2cfb5d5fe
[ "OML" ]
null
null
null
weather_api/weather_api/urls.py
brian-duffy/yoyo-test
65700a0061022e326a0048695c122ea2cfb5d5fe
[ "OML" ]
12
2019-12-26T16:40:09.000Z
2022-03-11T23:17:44.000Z
weather_api/weather_api/urls.py
brian-duffy/yoyo-test
65700a0061022e326a0048695c122ea2cfb5d5fe
[ "OML" ]
null
null
null
"""weather_api URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
38.125
107
0.711475
from django.conf.urls import url, include from django.views.generic import RedirectView urlpatterns = [ url(r'^$', RedirectView.as_view(url='https://github.com/brian-duffy/yoyo-test/blob/master/README.md')), url(r'weather_app/', include('weather_app.urls')), ]
true
true
f705183f4fbd0db80b7cc60b42c57b39c75bdeac
2,196
py
Python
curry.py
christianscott/curry.py
2a8ef4b40853dff6b239f794fcc0e3f9a157d7ab
[ "MIT" ]
2
2020-10-02T19:04:38.000Z
2021-10-01T10:51:14.000Z
curry.py
christianscott/curry.py
2a8ef4b40853dff6b239f794fcc0e3f9a157d7ab
[ "MIT" ]
3
2019-09-09T09:41:10.000Z
2019-09-09T09:41:33.000Z
curry.py
christianscott/curry.py
2a8ef4b40853dff6b239f794fcc0e3f9a157d7ab
[ "MIT" ]
1
2021-10-01T10:51:15.000Z
2021-10-01T10:51:15.000Z
"""Utility for currying functions.""" from functools import wraps from inspect import signature, isbuiltin, isclass def curry(func, args=None, kwargs=None, n=None, use_defaults=False): if use_defaults: return CurriedDefault(func, args, kwargs, n) return Curried(func, args, kwargs, n) class Curried...
28.519481
109
0.676685
from functools import wraps from inspect import signature, isbuiltin, isclass def curry(func, args=None, kwargs=None, n=None, use_defaults=False): if use_defaults: return CurriedDefault(func, args, kwargs, n) return Curried(func, args, kwargs, n) class Curried: def __init__(self, func, args=No...
true
true
f7051948f84339215d44128dbd1290fdb16a154f
786
py
Python
datalad/interface/download_url.py
AKSoo/datalad
dbc34478980c808a86b5531316c986abac953e37
[ "MIT" ]
null
null
null
datalad/interface/download_url.py
AKSoo/datalad
dbc34478980c808a86b5531316c986abac953e37
[ "MIT" ]
1
2020-12-01T20:13:51.000Z
2020-12-01T20:13:51.000Z
datalad/interface/download_url.py
jwodder/datalad
2b92a764fdc64b750dad68eb51c817218a1ec153
[ "MIT" ]
null
null
null
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ...
37.428571
87
0.57888
true
true
f7051a146cd3b773029e9815898f0cb11b731acd
30,749
py
Python
venv/lib/python2.7/site-packages/flask_login.py
jessekl/twiliochallenge
2bba8bc2e0928880f1e2abe6b53b96dbc67ef34f
[ "MIT" ]
2
2015-11-05T09:43:45.000Z
2017-05-31T14:22:02.000Z
flask/lib/site-packages/flask_login.py
CodingForChange/praquemdoar
575d67d211473f352adcd9d7c405c7a5cf18fc6e
[ "Apache-2.0" ]
null
null
null
flask/lib/site-packages/flask_login.py
CodingForChange/praquemdoar
575d67d211473f352adcd9d7c405c7a5cf18fc6e
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- ''' flask.ext.login --------------- This module provides user session management for Flask. It lets you log your users in and out in a database-independent manner. :copyright: (c) 2011 by Matthew Frazier. :license: MIT/X11, see LICENSE for more details. ''' __version_i...
34.902384
79
0.652769
__version_info__ = ('0', '2', '10') __version__ = '.'.join(__version_info__) __author__ = 'Matthew Frazier' __license__ = 'MIT/X11' __copyright__ = '(c) 2011 by Matthew Frazier' __all__ = ['LoginManager'] from flask import (_request_ctx_stack, abort, current_app, flash, redirect, request, session,...
true
true
f7051a67059458f6d2cad51d17c0a7cb5a24956f
4,906
py
Python
format.py
foolip/mediasession
24ec24185a003acba11151300d8512eeaf39f03c
[ "CC0-1.0" ]
52
2016-06-22T01:57:03.000Z
2019-07-24T08:23:27.000Z
format.py
jpmedley/mediasession
f17cd169443cb7b8ab69890fb27aa4e8d023258b
[ "W3C" ]
99
2016-07-08T10:43:08.000Z
2019-07-19T01:14:33.000Z
format.py
jpmedley/mediasession
f17cd169443cb7b8ab69890fb27aa4e8d023258b
[ "W3C" ]
13
2019-08-23T03:45:49.000Z
2022-03-15T21:43:57.000Z
#!/usr/bin/env python ## # Python script to tidy mediasession.bs # # adapted from: https://github.com/w3c/webvtt/blob/41cac9c211f9c581de466bb9b8b5dd11a160ffad/format.py ## import re import sys # http://stackoverflow.com/q/1732348 pattern = re.compile(r'<(\w+).*?>|</(\w+)>|<!--(.*?)-->', re.DOTALL) INDENT = ' ' COL...
29.202381
101
0.517326
import re import sys pattern = re.compile(r'<(\w+).*?>|</(\w+)>|<!--(.*?)-->', re.DOTALL) INDENT = ' ' COLUMNS = 80 def hasendtag(name): return name not in ['br', 'img', 'meta'] def tokenize(source): offset = 0 for match in pattern.finditer(source): if match.start() > offset: ...
false
true
f7051b7428786e0b7f886329953a90031763923e
326,148
py
Python
python/pycml/translators.py
ktunya/ChasteMod
88ac65b00473cd730d348c783bd74b2b39de5f69
[ "Apache-2.0" ]
null
null
null
python/pycml/translators.py
ktunya/ChasteMod
88ac65b00473cd730d348c783bd74b2b39de5f69
[ "Apache-2.0" ]
null
null
null
python/pycml/translators.py
ktunya/ChasteMod
88ac65b00473cd730d348c783bd74b2b39de5f69
[ "Apache-2.0" ]
null
null
null
# We want 1/2==0.5 from __future__ import division """Copyright (c) 2005-2015, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste....
48.261024
188
0.601304
from __future__ import division """Copyright (c) 2005-2015, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution a...
false
true
f7051d918dd37949e61a5f9a742e216e26e774b9
12,368
py
Python
python/ccxt/lykke.py
mikepsinn/ccxt
04c73735f53a7f28f5f4bd7f6846503047297138
[ "MIT" ]
1
2019-03-12T09:30:24.000Z
2019-03-12T09:30:24.000Z
python/ccxt/lykke.py
mikepsinn/ccxt
04c73735f53a7f28f5f4bd7f6846503047297138
[ "MIT" ]
null
null
null
python/ccxt/lykke.py
mikepsinn/ccxt
04c73735f53a7f28f5f4bd7f6846503047297138
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange import math class lykke (Exchange): def describe(self): return self.deep_extend(supe...
35.849275
126
0.467416
ge import Exchange import math class lykke (Exchange): def describe(self): return self.deep_extend(super(lykke, self).describe(), { 'id': 'lykke', 'name': 'Lykke', 'countries': 'CH', 'version': 'v1', 'rateLimit': 200, 'has': { ...
true
true
f7051dc01ebdfbe27bb258f790b4db971830c134
17,851
py
Python
unittests/ray_tracer/test_kdtree.py
nasa/giant
1e939272d9a0ca533b4da400d132f854520f3adc
[ "NASA-1.3" ]
5
2021-09-10T14:29:19.000Z
2022-01-13T20:15:01.000Z
unittests/ray_tracer/test_kdtree.py
nasa/giant
1e939272d9a0ca533b4da400d132f854520f3adc
[ "NASA-1.3" ]
null
null
null
unittests/ray_tracer/test_kdtree.py
nasa/giant
1e939272d9a0ca533b4da400d132f854520f3adc
[ "NASA-1.3" ]
2
2021-10-01T18:39:13.000Z
2021-12-30T08:53:08.000Z
from unittest import TestCase, skip import copy import numpy as np from giant import rotations as at from giant.ray_tracer import kdtree, shapes, rays class TestKDTree(TestCase): def setUp(self): self.max_depth = 4 tri1 = np.array([[-5, -4, -4.5], [0, 0, 1], ...
35.702
142
0.493866
from unittest import TestCase, skip import copy import numpy as np from giant import rotations as at from giant.ray_tracer import kdtree, shapes, rays class TestKDTree(TestCase): def setUp(self): self.max_depth = 4 tri1 = np.array([[-5, -4, -4.5], [0, 0, 1], ...
true
true
f7051dc56c585ff1a625d6db41e7759458136b36
446
py
Python
scripts/debian/usr/lib/dipicar/scripts/installation/ssl_keys_gen.py
TeaFlex/DiPiCar
e56f74ac55f5cfff22fd82807b06dc367c42cac0
[ "0BSD" ]
1
2021-07-10T13:41:00.000Z
2021-07-10T13:41:00.000Z
scripts/debian/usr/lib/dipicar/scripts/installation/ssl_keys_gen.py
TeaFlex/DiPiCar
e56f74ac55f5cfff22fd82807b06dc367c42cac0
[ "0BSD" ]
null
null
null
scripts/debian/usr/lib/dipicar/scripts/installation/ssl_keys_gen.py
TeaFlex/DiPiCar
e56f74ac55f5cfff22fd82807b06dc367c42cac0
[ "0BSD" ]
null
null
null
#!/usr/bin/python3 from subprocess import call; from sys import argv from os import path outPath = argv[1] if(len(argv)>1) else "/etc/dipicar/creds" duration = 365 rsaLength = 4096 #Generate ssl keys call([ "openssl", "req", "-x509", "-newkey", "rsa:"+str(rsaLength), "-keyout", path.join...
19.391304
59
0.596413
from subprocess import call; from sys import argv from os import path outPath = argv[1] if(len(argv)>1) else "/etc/dipicar/creds" duration = 365 rsaLength = 4096 call([ "openssl", "req", "-x509", "-newkey", "rsa:"+str(rsaLength), "-keyout", path.join(outPath,"key.pem"), "-out", pa...
true
true
f705210f06709ba3f43e67e92c0421ff78f57d45
649
py
Python
chalicelib/api/taxiAvailability.py
yeukfei02/singapore-taxi-api
25749c3a8c07849d4a2a13410da712ca64d102ca
[ "MIT" ]
null
null
null
chalicelib/api/taxiAvailability.py
yeukfei02/singapore-taxi-api
25749c3a8c07849d4a2a13410da712ca64d102ca
[ "MIT" ]
1
2021-05-04T03:30:01.000Z
2021-05-05T13:38:41.000Z
chalicelib/api/taxiAvailability.py
yeukfei02/singapore-taxi-api
25749c3a8c07849d4a2a13410da712ca64d102ca
[ "MIT" ]
null
null
null
import requests import os ROOT_URL = 'http://datamall2.mytransport.sg/ltaodataservice' def get_taxi_availability_request(): result = None try: url = '{}/Taxi-Availability'.format(ROOT_URL) headers = { 'AccountKey': os.getenv('ACCOUNT_KEY'), 'Accept': 'application/json...
24.037037
60
0.604006
import requests import os ROOT_URL = 'http://datamall2.mytransport.sg/ltaodataservice' def get_taxi_availability_request(): result = None try: url = '{}/Taxi-Availability'.format(ROOT_URL) headers = { 'AccountKey': os.getenv('ACCOUNT_KEY'), 'Accept': 'application/json...
true
true
f7052138819216e6f5c48540636b581bd627c13e
1,164
py
Python
ocdb/ws/handlers/__init__.py
eocdb/ocdb-server
0e28d092e8ecf5f4813878aab43de990cc5fb4ee
[ "MIT" ]
null
null
null
ocdb/ws/handlers/__init__.py
eocdb/ocdb-server
0e28d092e8ecf5f4813878aab43de990cc5fb4ee
[ "MIT" ]
1
2019-06-21T09:43:01.000Z
2019-06-21T09:43:01.000Z
eocdb/ws/handlers/__init__.py
bcdev/ocdb-server
027078f2b022a06b3a417d76d273514a72f8cac7
[ "MIT" ]
null
null
null
# The MIT License (MIT) # Copyright (c) 2018 by EUMETSAT # # 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, modify,...
48.5
81
0.77921
from ._mappings import MAPPINGS, API_URL_PREFIX
true
true
f705217d4ccc8cc742ed3dae28f533f8474e2433
1,752
py
Python
tests/adapters/model/elasticsearch_model/elements.py
mpsiva89/protean
315fa56da3f64178bbbf0edf1995af46d5eb3da7
[ "BSD-3-Clause" ]
null
null
null
tests/adapters/model/elasticsearch_model/elements.py
mpsiva89/protean
315fa56da3f64178bbbf0edf1995af46d5eb3da7
[ "BSD-3-Clause" ]
null
null
null
tests/adapters/model/elasticsearch_model/elements.py
mpsiva89/protean
315fa56da3f64178bbbf0edf1995af46d5eb3da7
[ "BSD-3-Clause" ]
null
null
null
import re from collections import defaultdict from datetime import datetime from elasticsearch_dsl import Keyword, Text from protean import BaseAggregate, BaseValueObject from protean.core.model import BaseModel from protean.fields import DateTime, Integer, String from protean.fields import Text as ProteanText from ...
24.676056
62
0.703196
import re from collections import defaultdict from datetime import datetime from elasticsearch_dsl import Keyword, Text from protean import BaseAggregate, BaseValueObject from protean.core.model import BaseModel from protean.fields import DateTime, Integer, String from protean.fields import Text as ProteanText from ...
true
true
f70521986d834f98db5a48207bb5f18312adac09
3,207
py
Python
355.Design-Twitter.py
mickey0524/leetcode
6bedeb6ff29b02a97178cca464c5fd639951801f
[ "MIT" ]
18
2018-07-14T12:45:37.000Z
2022-03-26T14:51:04.000Z
355.Design-Twitter.py
mickey0524/leetcode
6bedeb6ff29b02a97178cca464c5fd639951801f
[ "MIT" ]
null
null
null
355.Design-Twitter.py
mickey0524/leetcode
6bedeb6ff29b02a97178cca464c5fd639951801f
[ "MIT" ]
3
2019-05-29T04:09:22.000Z
2021-06-07T23:37:46.000Z
# https://leetcode.com/problems/design-twitter/ # # algorithms # Medium (27.98%) # Total Accepted: 37,655 # Total Submissions: 134,594 from collections import defaultdict from bisect import insort class Twitter(object): def __init__(self): """ Initialize your data structure here. """...
29.971963
224
0.617711
from collections import defaultdict from bisect import insort class Twitter(object): def __init__(self): self.follow_map = defaultdict(set) self.followed_map = defaultdict(set) self.tweet_map = defaultdict(list) self.post_map = defaultdict(list) self.tweet_...
true
true
f705220d566871e203d73d64093d17551fc09aa8
4,506
py
Python
tactics.py
knuekim98/titfortat-simulator
96e1c92058d43b6e4641ea323772a7fdd22a4ccd
[ "MIT" ]
null
null
null
tactics.py
knuekim98/titfortat-simulator
96e1c92058d43b6e4641ea323772a7fdd22a4ccd
[ "MIT" ]
null
null
null
tactics.py
knuekim98/titfortat-simulator
96e1c92058d43b6e4641ea323772a7fdd22a4ccd
[ "MIT" ]
null
null
null
from const import result import random C, D = True, False def opponent(r): if r == result.COOP or r == result.DEFECT: return True return False # tit for tat class Tft: def __init__(self) -> None: self.score = 0 self.last_reaction = C def run(self): return self.last_...
20.669725
63
0.545717
from const import result import random C, D = True, False def opponent(r): if r == result.COOP or r == result.DEFECT: return True return False class Tft: def __init__(self) -> None: self.score = 0 self.last_reaction = C def run(self): return self.last_reaction ...
true
true
f705226f63166954703af3428c9ff9c96723765d
8,341
py
Python
autotest/test_gwf_uzf_surfdep.py
mkennard-aquaveo/modflow6
73a0553636362c90f7d134318e1f5d902dbdc4d3
[ "CC0-1.0" ]
null
null
null
autotest/test_gwf_uzf_surfdep.py
mkennard-aquaveo/modflow6
73a0553636362c90f7d134318e1f5d902dbdc4d3
[ "CC0-1.0" ]
null
null
null
autotest/test_gwf_uzf_surfdep.py
mkennard-aquaveo/modflow6
73a0553636362c90f7d134318e1f5d902dbdc4d3
[ "CC0-1.0" ]
null
null
null
import os import pytest import sys import numpy as np import shutil import subprocess try: import pymake except: msg = "Error. Pymake package is not available.\n" msg += "Try installing using the following command:\n" msg += " pip install https://github.com/modflowpy/pymake/zipball/master" raise Ex...
30.665441
79
0.531111
import os import pytest import sys import numpy as np import shutil import subprocess try: import pymake except: msg = "Error. Pymake package is not available.\n" msg += "Try installing using the following command:\n" msg += " pip install https://github.com/modflowpy/pymake/zipball/master" raise Ex...
true
true
f70522e7e78a3344ab563ab228f5eece99510bcf
584
py
Python
tpv29/generate_mytopo_tpv29.py
sebwolf-de/Examples
329db390d540e6f5fe1dff35372528f723882271
[ "BSD-3-Clause" ]
3
2021-08-16T12:57:52.000Z
2021-11-02T23:39:36.000Z
tpv29/generate_mytopo_tpv29.py
sebwolf-de/Examples
329db390d540e6f5fe1dff35372528f723882271
[ "BSD-3-Clause" ]
22
2020-09-25T12:52:04.000Z
2022-02-09T14:51:20.000Z
tpv29/generate_mytopo_tpv29.py
sebwolf-de/Examples
329db390d540e6f5fe1dff35372528f723882271
[ "BSD-3-Clause" ]
11
2018-10-11T09:04:42.000Z
2021-12-06T17:17:39.000Z
import numpy as np # Read scec input file fid = open("tpv29_tpv30_geometry_25m_data.txt") line = fid.readline() line = fid.readline() header = [float(a) for a in line.split()] nx, ny, lx, ly = header roughness = np.loadtxt(fid) roughness = roughness[:, 4] fid.close() # create x and y vectors x = np.linspace(-lx / 2, ...
24.333333
47
0.64726
import numpy as np fid = open("tpv29_tpv30_geometry_25m_data.txt") line = fid.readline() line = fid.readline() header = [float(a) for a in line.split()] nx, ny, lx, ly = header roughness = np.loadtxt(fid) roughness = roughness[:, 4] fid.close() x = np.linspace(-lx / 2, lx / 2, int(nx) + 1) y = np.linspace(0, ly, in...
true
true
f70523fc884ca9381af67d78c3f7c35fb8498822
284
py
Python
tests/client/test_inmemory/conftest.py
zyfra/ebonite
b01b662c43709d152940f488574d78ff25f89ecf
[ "Apache-2.0" ]
270
2019-11-14T15:46:08.000Z
2021-09-17T16:43:03.000Z
tests/client/test_inmemory/conftest.py
leepand/ebonite
b01b662c43709d152940f488574d78ff25f89ecf
[ "Apache-2.0" ]
14
2019-11-29T11:49:39.000Z
2022-02-10T00:23:59.000Z
tests/client/test_inmemory/conftest.py
leepand/ebonite
b01b662c43709d152940f488574d78ff25f89ecf
[ "Apache-2.0" ]
18
2019-11-22T13:15:14.000Z
2021-09-01T13:36:12.000Z
import pytest from ebonite.client import Ebonite from tests.client.conftest import create_client_hooks @pytest.fixture def inmemory_ebnt(): ebnt = Ebonite.inmemory() yield ebnt pytest_runtest_protocol, pytest_collect_file = create_client_hooks(inmemory_ebnt, 'inmemory')
20.285714
93
0.806338
import pytest from ebonite.client import Ebonite from tests.client.conftest import create_client_hooks @pytest.fixture def inmemory_ebnt(): ebnt = Ebonite.inmemory() yield ebnt pytest_runtest_protocol, pytest_collect_file = create_client_hooks(inmemory_ebnt, 'inmemory')
true
true
f70524256bdfc9b0876254c7efcadd8c12f51182
3,165
py
Python
example1.py
srujan71/CubeSat-Mission-Planner
34030254109def0b13e82116ed5122ecf79a82f7
[ "MIT" ]
1
2021-07-26T16:17:30.000Z
2021-07-26T16:17:30.000Z
example1.py
leizhang2020/CubeSat-Mission-Planner
62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969
[ "MIT" ]
null
null
null
example1.py
leizhang2020/CubeSat-Mission-Planner
62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969
[ "MIT" ]
2
2021-09-18T08:50:44.000Z
2022-01-20T02:41:38.000Z
""" example1.py "A simple example how to use the CubeSat-Power-Estimation tool." @author: Johan Monster (https://github.com/Hans-Bananendans/) """ # Import packages import numpy as np import pandas as pd from mission import Mission # Defining the config config = { "years_passed" : 0, # How many [years] the sat...
29.858491
78
0.594945
import numpy as np import pandas as pd from mission import Mission config = { "years_passed" : 0, "battery_capacity" : 81000, "battery_degradation_factor" : 0.04, "battery_init" : 0.5, "panel_degradation_factor" : 0.02, "blip_period" : 30, "blip_duration" : 1, "n...
true
true
f7052438c8473f910759ed0cf1b17b8320d04873
653
py
Python
coredis/response/callbacks/acl.py
alisaifee/aredis
c5764a5a2a29c4ed25278548aa54eece94974440
[ "MIT" ]
null
null
null
coredis/response/callbacks/acl.py
alisaifee/aredis
c5764a5a2a29c4ed25278548aa54eece94974440
[ "MIT" ]
null
null
null
coredis/response/callbacks/acl.py
alisaifee/aredis
c5764a5a2a29c4ed25278548aa54eece94974440
[ "MIT" ]
null
null
null
from __future__ import annotations from coredis.response.callbacks import ( DictCallback, ResponseCallback, SimpleStringCallback, ) from coredis.response.utils import flat_pairs_to_dict from coredis.typing import Any, AnyStr, Mapping, Tuple, Union class ACLLogCallback(ResponseCallback): def transform...
29.681818
88
0.679939
from __future__ import annotations from coredis.response.callbacks import ( DictCallback, ResponseCallback, SimpleStringCallback, ) from coredis.response.utils import flat_pairs_to_dict from coredis.typing import Any, AnyStr, Mapping, Tuple, Union class ACLLogCallback(ResponseCallback): def transform...
true
true
f7052448208af15c670acb68c4d8a30ea3b9ff14
12,936
py
Python
mongo/src/third_party/wiredtiger/test/suite/test_timestamp04.py
coutamg/mongodb
3548e9feda217cd5b4bcc35b8d0452a7c25e3cd3
[ "Apache-2.0" ]
1
2021-06-02T05:13:29.000Z
2021-06-02T05:13:29.000Z
mongo/src/third_party/wiredtiger/test/suite/test_timestamp04.py
fanghaotianHT/reading-and-annotate-mongodb-3.6
3032cd9bbb1bb59eba2864582b81feba3e2e5b7a
[ "Apache-2.0" ]
null
null
null
mongo/src/third_party/wiredtiger/test/suite/test_timestamp04.py
fanghaotianHT/reading-and-annotate-mongodb-3.6
3032cd9bbb1bb59eba2864582b81feba3e2e5b7a
[ "Apache-2.0" ]
5
2020-12-16T13:31:55.000Z
2021-01-17T07:39:30.000Z
#!/usr/bin/env python # # Public Domain 2014-2017 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compil...
47.911111
112
0.637832
from suite_subprocess import suite_subprocess import wiredtiger, wttest from wtscenario import make_scenarios def timestamp_str(t): return '%x' % t class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess): table_ts_log = 'table:ts04_ts_logged' table_ts_nolog ...
false
true
f705245746d0ebe045665a381e0da85b1675e0cb
297
py
Python
tensornetwork/component_factory.py
gazay/TensorNetwork
1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e
[ "Apache-2.0" ]
2
2019-11-22T20:03:47.000Z
2020-09-03T20:25:51.000Z
tensornetwork/component_factory.py
gazay/TensorNetwork
1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e
[ "Apache-2.0" ]
null
null
null
tensornetwork/component_factory.py
gazay/TensorNetwork
1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e
[ "Apache-2.0" ]
3
2020-04-27T10:28:21.000Z
2021-03-02T10:02:14.000Z
from tensornetwork.network_components import Node, CopyNode, Edge _COMPONENTS = { "Node": Node, "CopyNode": CopyNode, "Edge": Edge, } def get_component(name): if name not in _COMPONENTS: raise ValueError("Component {} does not exist".format(name)) return _COMPONENTS[name]
19.8
65
0.703704
from tensornetwork.network_components import Node, CopyNode, Edge _COMPONENTS = { "Node": Node, "CopyNode": CopyNode, "Edge": Edge, } def get_component(name): if name not in _COMPONENTS: raise ValueError("Component {} does not exist".format(name)) return _COMPONENTS[name]
true
true
f7052482790afe437f8491bcd68bb6a5d319ef0d
3,563
py
Python
chapter10/image.py
atac-bham/pychapter10
292f15162d4a637144ab0e64ed7215a4ab4f37df
[ "BSD-3-Clause" ]
7
2021-04-27T12:14:42.000Z
2021-11-17T08:31:19.000Z
chapter10/image.py
atac-bham/pychapter10
292f15162d4a637144ab0e64ed7215a4ab4f37df
[ "BSD-3-Clause" ]
26
2020-07-20T21:28:57.000Z
2022-02-17T13:36:03.000Z
chapter10/image.py
atac-bham/pychapter10
292f15162d4a637144ab0e64ed7215a4ab4f37df
[ "BSD-3-Clause" ]
null
null
null
from .util import BitFormat from . import packet __all__ = ('ImageF0', 'ImageF1', 'ImageF2') class ImageMessage: def __repr__(self): return '<Image Segment>' class ImageF0(packet.Packet): """Image data .. py:attribute:: segment_length .. py:attribute:: iph .. py:attribute:: sum ...
23.912752
78
0.572551
from .util import BitFormat from . import packet __all__ = ('ImageF0', 'ImageF1', 'ImageF2') class ImageMessage: def __repr__(self): return '<Image Segment>' class ImageF0(packet.Packet): csdw_format = BitFormat(''' u27 length u1 iph u3 sum u3 parts''') clas...
true
true
f70524fefa5302b732e4c8435ba2d80c5c960673
3,066
py
Python
SDWLE/cards_copy/heroes.py
jomyhuang/sdwle
9b6e916567e09c7cba4a171fe0adf0f47009a8c3
[ "MIT" ]
null
null
null
SDWLE/cards_copy/heroes.py
jomyhuang/sdwle
9b6e916567e09c7cba4a171fe0adf0f47009a8c3
[ "MIT" ]
null
null
null
SDWLE/cards_copy/heroes.py
jomyhuang/sdwle
9b6e916567e09c7cba4a171fe0adf0f47009a8c3
[ "MIT" ]
null
null
null
from SDWLE.cards.base import HeroCard from SDWLE.constants import CHARACTER_CLASS, MINION_TYPE from SDWLE.powers import MagePower, DruidPower, HunterPower, PaladinPower, PriestPower, RoguePower,\ ShamanPower, WarlockPower, WarriorPower, JaraxxusPower, DieInsect class Malfurion(HeroCard): def __init__(self): ...
30.356436
104
0.660144
from SDWLE.cards.base import HeroCard from SDWLE.constants import CHARACTER_CLASS, MINION_TYPE from SDWLE.powers import MagePower, DruidPower, HunterPower, PaladinPower, PriestPower, RoguePower,\ ShamanPower, WarlockPower, WarriorPower, JaraxxusPower, DieInsect class Malfurion(HeroCard): def __init__(self): ...
true
true
f705257c65c84a3ef53edac3abe051b1978185f8
2,667
py
Python
glove/corpus.py
thibaultprouteau/glove-python
749494290fdfd24379dcc2e244c583ee61808634
[ "Apache-2.0" ]
1,148
2015-01-01T02:27:31.000Z
2022-03-31T17:16:05.000Z
glove/corpus.py
thibaultprouteau/glove-python
749494290fdfd24379dcc2e244c583ee61808634
[ "Apache-2.0" ]
78
2015-01-01T10:18:54.000Z
2021-08-06T06:53:24.000Z
glove/corpus.py
thibaultprouteau/glove-python
749494290fdfd24379dcc2e244c583ee61808634
[ "Apache-2.0" ]
352
2015-01-02T06:01:17.000Z
2022-03-22T12:21:51.000Z
# Cooccurrence matrix construction tools # for fitting the GloVe model. import numpy as np try: # Python 2 compat import cPickle as pickle except ImportError: import pickle from .corpus_cython import construct_cooccurrence_matrix class Corpus(object): """ Class for constructing a cooccurrence mat...
32.52439
82
0.558305
import numpy as np try: import cPickle as pickle except ImportError: import pickle from .corpus_cython import construct_cooccurrence_matrix class Corpus(object): def __init__(self, dictionary=None): self.dictionary = {} self.dictionary_supplied = False self.matrix = None ...
true
true
f7052ac37e1c8ecd7b7eb4f960efd1bcda7a3958
8,320
py
Python
action-baseline/evaluation/get_ava_performance.py
leaderj1001/Action-Localization
04d972e6dc3c07d347c70893723d91487c1c8cbd
[ "MIT" ]
24
2019-07-10T15:13:27.000Z
2021-07-08T12:12:40.000Z
action-baseline/evaluation/get_ava_performance.py
leaderj1001/Action-Localization
04d972e6dc3c07d347c70893723d91487c1c8cbd
[ "MIT" ]
7
2019-10-06T12:22:04.000Z
2020-04-15T13:14:10.000Z
action-baseline/evaluation/get_ava_performance.py
leaderj1001/Action-Localization
04d972e6dc3c07d347c70893723d91487c1c8cbd
[ "MIT" ]
4
2019-10-31T09:01:15.000Z
2021-03-26T04:20:21.000Z
r"""Compute action detection performance for the AVA dataset. Please send any questions about this code to the Google Group ava-dataset-users: https://groups.google.com/forum/#!forum/ava-dataset-users Example usage: python -O get_ava_performance.py \ -l ava/ava_action_list_v2.1_for_activitynet_2018.pbtxt.txt \ -g...
33.548387
98
0.679688
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse from collections import defaultdict import csv import heapq import logging import pprint import sys import time import numpy as np from evaluation.ava import object_detection_evaluation from e...
true
true
f7052b09a9ff46196bd8601792bc9ccca71459ca
192
py
Python
IdentityAccessManager/__init__.py
silop4all/iam
691316ca9ea7d3d10a3197b4d028e44e333c7060
[ "Apache-2.0" ]
2
2018-02-27T20:51:08.000Z
2019-11-25T10:11:59.000Z
IdentityAccessManager/__init__.py
silop4all/iam
691316ca9ea7d3d10a3197b4d028e44e333c7060
[ "Apache-2.0" ]
null
null
null
IdentityAccessManager/__init__.py
silop4all/iam
691316ca9ea7d3d10a3197b4d028e44e333c7060
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import # This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app
32
55
0.786458
from __future__ import absolute_import from .celery import app as celery_app
true
true
f7052baf507e53e8f68e20a709510cb920844c03
11,928
py
Python
aiopynoon/noon.py
alistairg/aiopynoon
f1340bd6a56de661e09f9f90fb28c331df2d5653
[ "MIT" ]
1
2020-06-18T06:29:40.000Z
2020-06-18T06:29:40.000Z
aiopynoon/noon.py
alistairg/aiopynoon
f1340bd6a56de661e09f9f90fb28c331df2d5653
[ "MIT" ]
null
null
null
aiopynoon/noon.py
alistairg/aiopynoon
f1340bd6a56de661e09f9f90fb28c331df2d5653
[ "MIT" ]
null
null
null
import logging import asyncio from asyncio import CancelledError from aiohttp import ClientSession, WSMsgType, ClientTimeout, WSServerHandshakeError import json import datetime import traceback import typing from .const import ( LOGIN_URL, DEX_URL, Guid ) from .space import NoonSpace from .line import NoonL...
38.980392
165
0.597082
import logging import asyncio from asyncio import CancelledError from aiohttp import ClientSession, WSMsgType, ClientTimeout, WSServerHandshakeError import json import datetime import traceback import typing from .const import ( LOGIN_URL, DEX_URL, Guid ) from .space import NoonSpace from .line import NoonL...
true
true
f7052c1b310c4f6ff723bac7bb1d25d4a354f20d
6,206
py
Python
tools/train_net.py
lxtGH/cvpods-1
fb61b6a63dfa65b21a782a4fc7e15a88ce018c51
[ "Apache-2.0" ]
1
2021-04-24T17:01:29.000Z
2021-04-24T17:01:29.000Z
tools/train_net.py
wondervictor/cvpods
614a975e5425bbaeb66bbd1ffca552d633ba89ca
[ "Apache-2.0" ]
null
null
null
tools/train_net.py
wondervictor/cvpods
614a975e5425bbaeb66bbd1ffca552d633ba89ca
[ "Apache-2.0" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Modified by BaseDetection, Inc. and its affiliates. All Rights Reserved """ Detection Training Script. This scripts reads a given config file and runs the training or evaluation. It is an entry point that is made to train standard models in cvpod...
36.505882
100
0.679987
import logging import os import pickle as pkl import sys from collections import OrderedDict from colorama import Fore, Style import torch from cvpods.checkpoint import DetectionCheckpointer from cvpods.engine import DefaultTrainer, default_argument_parser, default_setup, hooks, launch from cvpods.evaluation import...
true
true
f7052ff86a7ae193a4261efa32bdb7d04b30b4c6
362
py
Python
core/migrations/0073_rename_name_lt_product_name.py
Nephrolog-lt/nephrolog-api
ccd2162aff02b2abfab0f285779e5d8457be1788
[ "Apache-2.0" ]
2
2020-12-17T13:50:42.000Z
2021-01-09T07:01:07.000Z
core/migrations/0073_rename_name_lt_product_name.py
Nephrolog-lt/nephrolog-api
ccd2162aff02b2abfab0f285779e5d8457be1788
[ "Apache-2.0" ]
2
2021-08-25T05:02:56.000Z
2022-01-16T18:29:49.000Z
core/migrations/0073_rename_name_lt_product_name.py
Nephrolog-lt/nephrolog-api
ccd2162aff02b2abfab0f285779e5d8457be1788
[ "Apache-2.0" ]
1
2020-11-16T01:40:15.000Z
2020-11-16T01:40:15.000Z
# Generated by Django 3.2.3 on 2021-05-17 16:22 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0072_alter_product_region'), ] operations = [ migrations.RenameField( model_name='product', old_name='name_lt', ...
19.052632
47
0.582873
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0072_alter_product_region'), ] operations = [ migrations.RenameField( model_name='product', old_name='name_lt', new_name='name', ), ]
true
true
f705308018a1ffa77d87e188b5c43d4d6f2d194a
18,888
py
Python
wplay/utils/target_search.py
payal-98/whatsapp-play
3d667ee26c2ef6c29a12a5338e22ec9f8458a55c
[ "MIT" ]
1
2020-03-25T12:25:40.000Z
2020-03-25T12:25:40.000Z
wplay/utils/target_search.py
payal-98/whatsapp-play
3d667ee26c2ef6c29a12a5338e22ec9f8458a55c
[ "MIT" ]
null
null
null
wplay/utils/target_search.py
payal-98/whatsapp-play
3d667ee26c2ef6c29a12a5338e22ec9f8458a55c
[ "MIT" ]
null
null
null
__author__ = 'Alexandre Calil Martins Fonseca, github: xandao6' # region TUTORIAL ''' Go to region 'FOR SCRIPTING' and use the methods in your script! EXAMPLE OF USAGE: from wplay.pyppeteerUtils import pyppeteerConfig as pypConfig from wplay.pyppeteerUtils import pyppeteerSearch as pypSearch async def my_script(tar...
38.94433
189
0.72194
__author__ = 'Alexandre Calil Martins Fonseca, github: xandao6' from wplay.utils.helpers import whatsapp_selectors_dict from wplay.utils import Logger from wplay.utils.helpers import logs_path from pyppeteer.errors import ElementHandleError async def search_and_select_target(page, target, hide_groups=False):...
true
true
f7053131cfb854f87cef18f6a13009e7cb2dedd0
349
py
Python
21 Others/BEG.py
XuuRee/python-data-structures
a3972f5781d666d15d61c0d474877880d1b7c483
[ "MIT" ]
null
null
null
21 Others/BEG.py
XuuRee/python-data-structures
a3972f5781d666d15d61c0d474877880d1b7c483
[ "MIT" ]
null
null
null
21 Others/BEG.py
XuuRee/python-data-structures
a3972f5781d666d15d61c0d474877880d1b7c483
[ "MIT" ]
null
null
null
def beg(arr): a = [] b = [] c = [] for i in arr: if i == 0: a.append(i) if i == 1: b.append(i) if i == 2: c.append(i) return a+b+c a = [] b = [0,0,0] c = [1,2,1,1,2,1,2] d = [0,2,1,0,1,0,2,2,2,1,0,2,1,0,1,2,0] print(beg(a)) print(beg(b)...
14.541667
39
0.381089
def beg(arr): a = [] b = [] c = [] for i in arr: if i == 0: a.append(i) if i == 1: b.append(i) if i == 2: c.append(i) return a+b+c a = [] b = [0,0,0] c = [1,2,1,1,2,1,2] d = [0,2,1,0,1,0,2,2,2,1,0,2,1,0,1,2,0] print(beg(a)) print(beg(b)...
true
true
f7053142d8894d29c2b779e200a2ae10343b6829
138
py
Python
modules/msa/msa/contrib/master/apps.py
haoyutan/MSA-Framework
7c5553b244347f26029729161e15e60b0cc805f5
[ "MIT" ]
2
2016-11-22T11:44:52.000Z
2017-08-29T02:38:01.000Z
modules/msa/msa/contrib/master/apps.py
haoyutan/MSA-Framework
7c5553b244347f26029729161e15e60b0cc805f5
[ "MIT" ]
null
null
null
modules/msa/msa/contrib/master/apps.py
haoyutan/MSA-Framework
7c5553b244347f26029729161e15e60b0cc805f5
[ "MIT" ]
null
null
null
from django.apps import AppConfig class MasterAppConfig(AppConfig): name = 'msa.contrib.master' verbose_name = 'Master Service'
19.714286
35
0.746377
from django.apps import AppConfig class MasterAppConfig(AppConfig): name = 'msa.contrib.master' verbose_name = 'Master Service'
true
true
f70531491a4fe1bfff0ca5ec957d7f9cd2f74762
8,381
py
Python
quetz_frontend/cli.py
hbcarlos/quetz-frontend
86a41de3a3e05c4c324bf2c5f2d4dda76a4fa3ce
[ "BSD-3-Clause" ]
null
null
null
quetz_frontend/cli.py
hbcarlos/quetz-frontend
86a41de3a3e05c4c324bf2c5f2d4dda76a4fa3ce
[ "BSD-3-Clause" ]
null
null
null
quetz_frontend/cli.py
hbcarlos/quetz-frontend
86a41de3a3e05c4c324bf2c5f2d4dda76a4fa3ce
[ "BSD-3-Clause" ]
null
null
null
import importlib import json import os import shutil import subprocess from pathlib import Path from shutil import which from typing import List, Optional, Tuple from setuptools import find_packages from typer import Argument, Option, Typer from .paths import ( GLOBAL_APP_DIR, GLOBAL_EXTENSIONS_DIR, GLOBA...
26.862179
88
0.65386
import importlib import json import os import shutil import subprocess from pathlib import Path from shutil import which from typing import List, Optional, Tuple from setuptools import find_packages from typer import Argument, Option, Typer from .paths import ( GLOBAL_APP_DIR, GLOBAL_EXTENSIONS_DIR, GLOBA...
true
true
f70531e2ad32c627bf6d2ee9773984e911b06c5b
192
py
Python
socorepo/locators/__init__.py
LoadingByte/socorepo
c0880d3ad55c9d8f8aab53f5cc16600661c10c2b
[ "MIT" ]
null
null
null
socorepo/locators/__init__.py
LoadingByte/socorepo
c0880d3ad55c9d8f8aab53f5cc16600661c10c2b
[ "MIT" ]
null
null
null
socorepo/locators/__init__.py
LoadingByte/socorepo
c0880d3ad55c9d8f8aab53f5cc16600661c10c2b
[ "MIT" ]
null
null
null
from socorepo.locators import github_tags, nexus3, pypi LOCATOR_PARSERS = { "github_tags": github_tags.parse_locator, "nexus3": nexus3.parse_locator, "pypi": pypi.parse_locator }
24
55
0.744792
from socorepo.locators import github_tags, nexus3, pypi LOCATOR_PARSERS = { "github_tags": github_tags.parse_locator, "nexus3": nexus3.parse_locator, "pypi": pypi.parse_locator }
true
true
f705329421c3a54d538ba279a1d4c9007a13943a
3,953
py
Python
stopWords.py
AninditaBasu/mattermost-hackathon-stopWords
11781ee3f89bf66ebd9c2b11162a588a98b237b6
[ "MIT" ]
2
2019-11-25T19:22:24.000Z
2020-07-07T04:54:50.000Z
stopWords.py
AninditaBasu/mattermost-hackathon-stopWords
11781ee3f89bf66ebd9c2b11162a588a98b237b6
[ "MIT" ]
null
null
null
stopWords.py
AninditaBasu/mattermost-hackathon-stopWords
11781ee3f89bf66ebd9c2b11162a588a98b237b6
[ "MIT" ]
null
null
null
from flask import Flask, render_template, request import json import requests app = Flask(__name__) @app.route('/') def stop_words(): URL_prefix = 'https://api.github.com/search/code?q=' URL_suffix = '+repo:spotify/mkdocs-monorepo-plugin/docs' reportfile = open('./templates/stopWordsSearch.html', 'w') ...
47.059524
203
0.589679
from flask import Flask, render_template, request import json import requests app = Flask(__name__) @app.route('/') def stop_words(): URL_prefix = 'https://api.github.com/search/code?q=' URL_suffix = '+repo:spotify/mkdocs-monorepo-plugin/docs' reportfile = open('./templates/stopWordsSearch.html', 'w') ...
true
true
f705330137e0d77aaa9e47ecb94b760f7a854733
2,916
py
Python
django/contrib/contenttypes/management.py
KingWapo/django
115c307184d441fbc27a8f43a99af5d992cfcc13
[ "BSD-3-Clause" ]
2
2015-01-21T15:45:07.000Z
2015-02-21T02:38:13.000Z
env/lib/python2.7/site-packages/django/contrib/contenttypes/management.py
luiscarlosgph/nas
e5acee61e8bbf12c34785fe971ce7df8dee775d4
[ "MIT" ]
10
2019-12-26T17:31:31.000Z
2022-03-21T22:17:33.000Z
env/lib/python2.7/site-packages/django/contrib/contenttypes/management.py
luiscarlosgph/nas
e5acee61e8bbf12c34785fe971ce7df8dee775d4
[ "MIT" ]
1
2021-03-06T14:22:00.000Z
2021-03-06T14:22:00.000Z
from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS,...
29.16
101
0.63546
from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS,...
true
true
f705330f398c68077399fd500653c9cafa921704
4,870
py
Python
parlai/mturk/tasks/personachat/personachat_chat/run.py
khaimaitien/Mai_convai2
83bf99ba09d678455aad49239f3daefc5a7b8fc9
[ "BSD-3-Clause" ]
1
2018-09-28T05:47:45.000Z
2018-09-28T05:47:45.000Z
parlai/mturk/tasks/personachat/personachat_chat/run.py
crazyrex/ParlAI
fbfda4f4aadd357dfdb7b4baf230c45c039a1338
[ "BSD-3-Clause" ]
1
2018-09-27T17:11:24.000Z
2018-09-27T17:11:24.000Z
parlai/mturk/tasks/personachat/personachat_chat/run.py
khaimaitien/Mai_convai2
83bf99ba09d678455aad49239f3daefc5a7b8fc9
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. fro...
38.650794
150
0.626489
from parlai.core.params import ParlaiParser from parlai.mturk.core.mturk_manager import MTurkManager from worlds import \ PersonaChatWorld, PersonaProfileWorld, PersonasGenerator from task_config import task_config import os def main(): argparser = ParlaiParser(False, False) argparser.add_parlai_d...
true
true
f705343bf3fc1ba799d2ebee62971a89002e3bcf
2,523
py
Python
Ch_03/LogisticRegression.py
RafaelSouza94/Python_Machine_Learning
5b150613410ddc64a61690f232ec61751744fa41
[ "MIT" ]
null
null
null
Ch_03/LogisticRegression.py
RafaelSouza94/Python_Machine_Learning
5b150613410ddc64a61690f232ec61751744fa41
[ "MIT" ]
null
null
null
Ch_03/LogisticRegression.py
RafaelSouza94/Python_Machine_Learning
5b150613410ddc64a61690f232ec61751744fa41
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Logistic Regression Gradient Descent """ import numpy as np class LogisticRegressionGD(object): """Logistic Regression Classifier using gradient descent. Parameters ------------ eta : float Learning rate (between 0.0 and 1.0) n_iter :...
30.035714
63
0.52279
import numpy as np class LogisticRegressionGD(object): def __init__(self, eta=0.05, n_iter=100, random_state=1): self.eta = eta self.n_iter = n_iter self.random_state = random_state def fit(self, X, y): rgen = np.random.RandomState(self.random_state) self.w_ = rg...
true
true
f705365fe4791c97b8b3d6bace419ef73911d813
1,149
py
Python
airflow/hooks/mysql_hook.py
dorranh/airflow
1a9a2cadcf8606cfcb729d1323dd33dfacc64633
[ "Apache-2.0" ]
5
2020-07-17T07:33:58.000Z
2022-03-02T06:23:47.000Z
airflow/hooks/mysql_hook.py
dorranh/airflow
1a9a2cadcf8606cfcb729d1323dd33dfacc64633
[ "Apache-2.0" ]
7
2020-06-03T14:55:17.000Z
2021-12-30T00:01:50.000Z
airflow/hooks/mysql_hook.py
dorranh/airflow
1a9a2cadcf8606cfcb729d1323dd33dfacc64633
[ "Apache-2.0" ]
12
2020-01-09T14:02:39.000Z
2022-01-24T07:18:51.000Z
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
38.3
83
0.761532
import warnings from airflow.providers.mysql.hooks.mysql import MySqlHook warnings.warn( "This module is deprecated. Please use `airflow.providers.mysql.hooks.mysql`.", DeprecationWarning, stacklevel=2 )
true
true
f705371ad450409a7a5a8779c94a8bb544f9b844
114,476
py
Python
pyInstaller/plotly/graph_objs/treemap/__init__.py
rianawillers/dash-lineplot
b72c3e4799d39bdc33bbcae2202fdefd6f4af00e
[ "MIT" ]
2
2019-11-08T07:01:11.000Z
2019-11-17T10:10:49.000Z
pyInstaller/plotly/graph_objs/treemap/__init__.py
rianawillers/dash-lineplot
b72c3e4799d39bdc33bbcae2202fdefd6f4af00e
[ "MIT" ]
12
2020-06-06T01:22:26.000Z
2022-03-12T00:13:42.000Z
pyInstaller/plotly/graph_objs/treemap/__init__.py
rianawillers/dash-lineplot
b72c3e4799d39bdc33bbcae2202fdefd6f4af00e
[ "MIT" ]
17
2019-11-21T14:11:29.000Z
2019-11-21T15:26:23.000Z
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tiling(_BaseTraceHierarchyType): # flip # ---- @property def flip(self): """ Determines if the positions obtained from solver are flipped on each axis. Th...
35.408599
87
0.556737
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tiling(_BaseTraceHierarchyType): @property def flip(self): return self["flip"] @flip.setter def flip(self, val): self["flip"] = val @property def...
true
true
f705372d8ae86131f8816526842556b71e7b9ae5
337
py
Python
insta/urls.py
osman2491/Insta
f941f2b20f814e1c13fe0f9c02a1a60be3cd2c87
[ "MIT" ]
null
null
null
insta/urls.py
osman2491/Insta
f941f2b20f814e1c13fe0f9c02a1a60be3cd2c87
[ "MIT" ]
2
2021-06-10T22:33:39.000Z
2021-09-08T01:39:21.000Z
insta/urls.py
osman2491/Insta
f941f2b20f814e1c13fe0f9c02a1a60be3cd2c87
[ "MIT" ]
null
null
null
from django.conf.urls import url,include from django.contrib import admin from django.contrib.auth import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'',include('instagram.urls')), url(r'^accounts/', include('registration.backends.simple.urls')), url(r'^logout/$', views.logout, {"next...
33.7
69
0.682493
from django.conf.urls import url,include from django.contrib import admin from django.contrib.auth import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'',include('instagram.urls')), url(r'^accounts/', include('registration.backends.simple.urls')), url(r'^logout/$', views.logout, {"next...
true
true
f705378db8f82576f4e65044784728515b32f0c3
10,546
py
Python
vfm.py
jilljenn/vfm
4cb2f5157ee7301321bb4babedb62223a720d231
[ "MIT" ]
null
null
null
vfm.py
jilljenn/vfm
4cb2f5157ee7301321bb4babedb62223a720d231
[ "MIT" ]
null
null
null
vfm.py
jilljenn/vfm
4cb2f5157ee7301321bb4babedb62223a720d231
[ "MIT" ]
1
2020-01-15T07:06:52.000Z
2020-01-15T07:06:52.000Z
import chainer from chainer import training from chainer.training import extensions from chainer.datasets import TupleDataset from chainer import Chain from chainer import links as L from chainer import functions as F from chainer import reporter from chainer import cuda import numpy as np def dot(a, b): """ Sim...
39.94697
79
0.592737
import chainer from chainer import training from chainer.training import extensions from chainer.datasets import TupleDataset from chainer import Chain from chainer import links as L from chainer import functions as F from chainer import reporter from chainer import cuda import numpy as np def dot(a, b): return ...
true
true
f70537ece98c2114c69c2bae94f8b653352137eb
1,406
py
Python
cruft/_commands/check.py
lkubb/cruft
0c6de85d974197969c0e65913857eaa36b788e5e
[ "MIT" ]
293
2020-08-18T05:52:45.000Z
2022-03-31T20:39:43.000Z
cruft/_commands/check.py
lkubb/cruft
0c6de85d974197969c0e65913857eaa36b788e5e
[ "MIT" ]
102
2020-08-28T16:38:34.000Z
2022-03-31T11:01:41.000Z
cruft/_commands/check.py
lkubb/cruft
0c6de85d974197969c0e65913857eaa36b788e5e
[ "MIT" ]
36
2020-08-28T16:34:10.000Z
2022-03-31T21:55:53.000Z
import json from pathlib import Path from typing import Optional import typer from . import utils from .utils import example from .utils.iohelper import AltTemporaryDirectory @example() def check( project_dir: Path = Path("."), checkout: Optional[str] = None, strict: bool = True ) -> bool: """Checks to see ...
32.697674
97
0.619488
import json from pathlib import Path from typing import Optional import typer from . import utils from .utils import example from .utils.iohelper import AltTemporaryDirectory @example() def check( project_dir: Path = Path("."), checkout: Optional[str] = None, strict: bool = True ) -> bool: cruft_file = util...
true
true
f70538b2530870bd171f664a575ee6f8c9d80b7c
4,110
py
Python
qa/rpc-tests/merkle_blocks.py
realcaesar/skicoinBeta
a35cbfda4f70cfa41daa3e80fba95d737ef64449
[ "MIT" ]
null
null
null
qa/rpc-tests/merkle_blocks.py
realcaesar/skicoinBeta
a35cbfda4f70cfa41daa3e80fba95d737ef64449
[ "MIT" ]
null
null
null
qa/rpc-tests/merkle_blocks.py
realcaesar/skicoinBeta
a35cbfda4f70cfa41daa3e80fba95d737ef64449
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 # Copyright (c) 2014-2020 The Bitcoin Core developers # Copyright (c) 2014-2020 The Skicoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test merkleblock fetch/validation # from test_...
45.666667
120
0.672993
from test_framework.test_framework import SkicoinTestFramework from test_framework.util import * class MerkleBlockTest(SkicoinTestFramework): def setup_chain(self): print("Initializing test directory "+self.options.tmpdir) initialize_chain_clean(self.options.tmpdir, 4) def setup_net...
false
true
f70538f65e8861717efd58fa60cfc24ef08b2d0d
3,288
py
Python
tests/components/zha/test_switch.py
Squixx/home-assistant
152997e7589d3bad63181ca78cc296f54ae25aa2
[ "Apache-2.0" ]
null
null
null
tests/components/zha/test_switch.py
Squixx/home-assistant
152997e7589d3bad63181ca78cc296f54ae25aa2
[ "Apache-2.0" ]
null
null
null
tests/components/zha/test_switch.py
Squixx/home-assistant
152997e7589d3bad63181ca78cc296f54ae25aa2
[ "Apache-2.0" ]
null
null
null
"""Test zha switch.""" from unittest.mock import call, patch import pytest import zigpy.zcl.clusters.general as general import zigpy.zcl.foundation as zcl_f from homeassistant.components.switch import DOMAIN from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE from .common import ( async_enable...
31.615385
83
0.687956
from unittest.mock import call, patch import pytest import zigpy.zcl.clusters.general as general import zigpy.zcl.foundation as zcl_f from homeassistant.components.switch import DOMAIN from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE from .common import ( async_enable_traffic, find_enti...
true
true
f7053ab01509c24ced03b369dae6ac255d9ca094
4,288
py
Python
dp_conceptual_search/api/search/routes.py
flaxandteal/dp-conceptual-search
16c6383a61ba5b7069337c2626a0dc243bfe9d35
[ "MIT" ]
null
null
null
dp_conceptual_search/api/search/routes.py
flaxandteal/dp-conceptual-search
16c6383a61ba5b7069337c2626a0dc243bfe9d35
[ "MIT" ]
null
null
null
dp_conceptual_search/api/search/routes.py
flaxandteal/dp-conceptual-search
16c6383a61ba5b7069337c2626a0dc243bfe9d35
[ "MIT" ]
null
null
null
""" This file contains all routes for the /search API """ from sanic import Blueprint from sanic.response import HTTPResponse from dp4py_sanic.api.response.json_response import json from dp_conceptual_search.config import CONFIG from dp_conceptual_search.api.request import ONSRequest from dp_conceptual_search.ons.sea...
34.304
90
0.752332
from sanic import Blueprint from sanic.response import HTTPResponse from dp4py_sanic.api.response.json_response import json from dp_conceptual_search.config import CONFIG from dp_conceptual_search.api.request import ONSRequest from dp_conceptual_search.ons.search.index import Index from dp_conceptual_search.ons.searc...
true
true
f7053bc53f930cd972b3fb116080db388c2bf1b4
562
py
Python
common_utils/log_decorator.py
beansKingdom/CommonUtils
85f658671ddc6d52dc65e8d8c8bec5474a97a19f
[ "MIT" ]
null
null
null
common_utils/log_decorator.py
beansKingdom/CommonUtils
85f658671ddc6d52dc65e8d8c8bec5474a97a19f
[ "MIT" ]
4
2020-03-24T17:40:50.000Z
2021-06-02T00:25:27.000Z
common_utils/log_decorator.py
beansKingdom/CommonUtils
85f658671ddc6d52dc65e8d8c8bec5474a97a19f
[ "MIT" ]
null
null
null
# -*- coding: UTF-8 -*- from common_utils.new_log import NewLog class LogDecorator: log = NewLog(__name__) logger = log.get_log() def __call__(self, func): def wrapper(*args, **kw): self.logger.debug("call method %s ===============" % func.__name__) self.logger.debug("me...
29.578947
100
0.553381
from common_utils.new_log import NewLog class LogDecorator: log = NewLog(__name__) logger = log.get_log() def __call__(self, func): def wrapper(*args, **kw): self.logger.debug("call method %s ===============" % func.__name__) self.logger.debug("method [%s] input args: [...
true
true
f7053c939c0ae2e74aeebb8a418132b816d2cc31
6,017
py
Python
lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ultrahd.py
proxium/script.module.lambdascrapers
f96ad4c7c44c011c9d0007a83edde8c4797e0e2f
[ "Beerware" ]
11
2018-12-21T22:52:37.000Z
2021-09-02T02:13:50.000Z
lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ultrahd.py
proxium/script.module.lambdascrapers
f96ad4c7c44c011c9d0007a83edde8c4797e0e2f
[ "Beerware" ]
null
null
null
lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ultrahd.py
proxium/script.module.lambdascrapers
f96ad4c7c44c011c9d0007a83edde8c4797e0e2f
[ "Beerware" ]
1
2020-02-01T19:52:36.000Z
2020-02-01T19:52:36.000Z
# -*- coding: utf-8 -*- ''' Covenant Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
41.784722
127
0.442081
import re,urllib,urlparse from resources.lib.modules import cleantitle from resources.lib.modules import client from resources.lib.modules import debrid from resources.lib.modules import source_utils from resources.lib.modules import dom_parser2 class source: def __init__(self): self.priori...
true
true
f7053cb96e078cbb641803774c57e3d6c47395cc
5,903
py
Python
src/_repobee/disthelpers.py
tohanss/repobee
cf5eb1e83e62c20bbca00c8ad9f798a612e1664f
[ "MIT" ]
null
null
null
src/_repobee/disthelpers.py
tohanss/repobee
cf5eb1e83e62c20bbca00c8ad9f798a612e1664f
[ "MIT" ]
null
null
null
src/_repobee/disthelpers.py
tohanss/repobee
cf5eb1e83e62c20bbca00c8ad9f798a612e1664f
[ "MIT" ]
null
null
null
"""Helper functions for the distribution.""" import importlib import json import pathlib import subprocess import sys import types import os from typing import Optional, List import requests import repobee_plug as plug import _repobee.ext from _repobee import distinfo from _repobee import plugin class DependencyRe...
32.256831
79
0.671015
import importlib import json import pathlib import subprocess import sys import types import os from typing import Optional, List import requests import repobee_plug as plug import _repobee.ext from _repobee import distinfo from _repobee import plugin class DependencyResolutionError(plug.PlugError): def get_inst...
true
true
f7053dfef19a421a63c39a67f749f72d485326f3
440
py
Python
ratings-counter.py
csagar131/pyspark-scripts
7357baa1dc5499149e4e1041768827eee6209804
[ "Apache-2.0" ]
null
null
null
ratings-counter.py
csagar131/pyspark-scripts
7357baa1dc5499149e4e1041768827eee6209804
[ "Apache-2.0" ]
null
null
null
ratings-counter.py
csagar131/pyspark-scripts
7357baa1dc5499149e4e1041768827eee6209804
[ "Apache-2.0" ]
null
null
null
from pyspark import SparkConf, SparkContext import collections conf = SparkConf().setMaster("local").setAppName("RatingsHistogram") sc = SparkContext(conf = conf) lines = sc.textFile("D:/celebal/resources/ml-100k/u.data") ratings = lines.map(lambda x: x.split()[2]) result = ratings.countByValue() sortedResults = col...
31.428571
68
0.738636
from pyspark import SparkConf, SparkContext import collections conf = SparkConf().setMaster("local").setAppName("RatingsHistogram") sc = SparkContext(conf = conf) lines = sc.textFile("D:/celebal/resources/ml-100k/u.data") ratings = lines.map(lambda x: x.split()[2]) result = ratings.countByValue() sortedResults = col...
true
true
f705402b1b08aa6730ba341cc50c68502d1b99d6
17,851
py
Python
tests/test_scheduler.py
atlas555/pyspider
8f71e0e8d67f03a728cd5ea48fa931f6415e1e10
[ "Apache-2.0" ]
5
2015-03-31T13:25:25.000Z
2016-03-14T11:17:02.000Z
tests/test_scheduler.py
e-dorigatti/pyspider
8f71e0e8d67f03a728cd5ea48fa931f6415e1e10
[ "Apache-2.0" ]
null
null
null
tests/test_scheduler.py
e-dorigatti/pyspider
8f71e0e8d67f03a728cd5ea48fa931f6415e1e10
[ "Apache-2.0" ]
1
2016-02-17T23:12:47.000Z
2016-02-17T23:12:47.000Z
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-08 22:37:13 import os import time import shutil import unittest2 as unittest import logging import logging.config logging.config.fileConfig("pyspid...
30.671821
99
0.503893
import os import time import shutil import unittest2 as unittest import logging import logging.config logging.config.fileConfig("pyspider/logging.conf") from pyspider.scheduler.task_queue import TaskQueue class TestTaskQueue(unittest.TestCase): @classmethod def setUpClass(self): self.task_que...
true
true
f7054098e4be98d0e7ded502ff3e25b7159a4400
2,065
py
Python
profiles_api/models.py
tanveerahmaddar/profiles-rest-api
1fd5060677bbefd6bb2d02179587a1d8005f3bc1
[ "MIT" ]
null
null
null
profiles_api/models.py
tanveerahmaddar/profiles-rest-api
1fd5060677bbefd6bb2d02179587a1d8005f3bc1
[ "MIT" ]
5
2021-03-19T12:00:14.000Z
2022-02-10T09:29:53.000Z
profiles_api/models.py
tanveerahmaddar/profiles-rest-api
1fd5060677bbefd6bb2d02179587a1d8005f3bc1
[ "MIT" ]
null
null
null
from django.db import models from django.contrib.auth.models import AbstractBaseUser from django.contrib.auth.models import PermissionsMixin from django.contrib.auth.models import BaseUserManager from django.conf import settings class UserProfileManager(BaseUserManager): """Manager for user profiles""" def c...
28.287671
64
0.680872
from django.db import models from django.contrib.auth.models import AbstractBaseUser from django.contrib.auth.models import PermissionsMixin from django.contrib.auth.models import BaseUserManager from django.conf import settings class UserProfileManager(BaseUserManager): def create_user(self, email, name, passwo...
true
true
f70541311d2804278f3802c1efeec5ac64b356ca
41,783
py
Python
zipline/pipeline/factors/factor.py
degiere/zipline
bc0b117dc94b8e93081818964e3b1bdbf9b33abb
[ "Apache-2.0" ]
null
null
null
zipline/pipeline/factors/factor.py
degiere/zipline
bc0b117dc94b8e93081818964e3b1bdbf9b33abb
[ "Apache-2.0" ]
null
null
null
zipline/pipeline/factors/factor.py
degiere/zipline
bc0b117dc94b8e93081818964e3b1bdbf9b33abb
[ "Apache-2.0" ]
1
2019-09-20T01:08:33.000Z
2019-09-20T01:08:33.000Z
""" factor.py """ from functools import wraps from operator import attrgetter from numbers import Number from numpy import inf, where from toolz import curry from zipline.errors import UnknownRankMethod from zipline.lib.normalize import naive_grouped_rowwise_apply from zipline.lib.rank import masked_rankdata_2d from ...
33.506816
79
0.604026
from functools import wraps from operator import attrgetter from numbers import Number from numpy import inf, where from toolz import curry from zipline.errors import UnknownRankMethod from zipline.lib.normalize import naive_grouped_rowwise_apply from zipline.lib.rank import masked_rankdata_2d from zipline.pipeline.c...
true
true
f705417d19cb9869018feb9f86bc6330c83dbbeb
1,953
py
Python
secretmanager/api-client/destroy_secret_version.py
m-abba/python-docs-samples
b00f00d734b89edae8ae6876d6261e19dc82cd34
[ "Apache-2.0" ]
1
2020-03-05T18:24:45.000Z
2020-03-05T18:24:45.000Z
secretmanager/api-client/destroy_secret_version.py
m-abba/python-docs-samples
b00f00d734b89edae8ae6876d6261e19dc82cd34
[ "Apache-2.0" ]
1
2022-01-14T23:28:27.000Z
2022-01-14T23:28:27.000Z
secretmanager/api-client/destroy_secret_version.py
m-abba/python-docs-samples
b00f00d734b89edae8ae6876d6261e19dc82cd34
[ "Apache-2.0" ]
2
2020-06-07T07:03:00.000Z
2021-04-10T18:22:25.000Z
#!/usr/bin/env python # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
34.263158
79
0.752176
import argparse def destroy_secret_version(project_id, secret_id, version_id): from google.cloud import secretmanager_v1beta1 as secretmanager client = secretmanager.SecretManagerServiceClient() name = client.secret_version_path(project_id, secret_id, version_id) ...
true
true
f70541b4e93276103e9e98cfbbb64f631c2d887a
57,219
py
Python
trac/ticket/tests/functional.py
wiraqutra/photrackjp
e120cba2a5d5d30f99ad084c6521e61f09694ee6
[ "BSD-3-Clause" ]
null
null
null
trac/ticket/tests/functional.py
wiraqutra/photrackjp
e120cba2a5d5d30f99ad084c6521e61f09694ee6
[ "BSD-3-Clause" ]
null
null
null
trac/ticket/tests/functional.py
wiraqutra/photrackjp
e120cba2a5d5d30f99ad084c6521e61f09694ee6
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/python import os import re from datetime import datetime, timedelta from trac.tests.functional import * from trac.util.datefmt import utc, localtz, format_date class TestTickets(FunctionalTwillTestCaseSetup): def runTest(self): """Create a ticket, comment on it, and attach a file"...
39.515884
90
0.617837
import os import re from datetime import datetime, timedelta from trac.tests.functional import * from trac.util.datefmt import utc, localtz, format_date class TestTickets(FunctionalTwillTestCaseSetup): def runTest(self): """Create a ticket, comment on it, and attach a file""" ...
false
true
f70541cbb5540d0c4d4bcc2d81b9b62daf4c08a3
13,756
py
Python
shapely/geometry/polygon.py
tsauerwein/shapely
d0bdd5f99cc8be9ce6a1022ff971fbd5deff2dad
[ "BSD-3-Clause" ]
null
null
null
shapely/geometry/polygon.py
tsauerwein/shapely
d0bdd5f99cc8be9ce6a1022ff971fbd5deff2dad
[ "BSD-3-Clause" ]
null
null
null
shapely/geometry/polygon.py
tsauerwein/shapely
d0bdd5f99cc8be9ce6a1022ff971fbd5deff2dad
[ "BSD-3-Clause" ]
null
null
null
"""Polygons and their linear ring components """ from ctypes import c_double, c_void_p, cast, POINTER from ctypes import ArgumentError import weakref from shapely.algorithms.cga import signed_area from shapely.coords import required from shapely.geos import lgeos from shapely.geometry.base import BaseGeometry from sh...
29.268085
81
0.557793
from ctypes import c_double, c_void_p, cast, POINTER from ctypes import ArgumentError import weakref from shapely.algorithms.cga import signed_area from shapely.coords import required from shapely.geos import lgeos from shapely.geometry.base import BaseGeometry from shapely.geometry.linestring import LineString, Line...
true
true
f70541d9d771fb542f9dab03839544e3d44ed928
658
py
Python
TryAPP1.0/condition.py
deepankur797/random
fc7a1ac60d9de08c79bc5f5676705e45531ce6d9
[ "MIT" ]
null
null
null
TryAPP1.0/condition.py
deepankur797/random
fc7a1ac60d9de08c79bc5f5676705e45531ce6d9
[ "MIT" ]
null
null
null
TryAPP1.0/condition.py
deepankur797/random
fc7a1ac60d9de08c79bc5f5676705e45531ce6d9
[ "MIT" ]
null
null
null
x=2 print(x == 2) print(x == 3) print(x<3) #Boolean operators name = "John" age = 23 if name == "John" and age == 23: print("Your name is John, and you are also 23 years old.") if name == "John" or name == "Rick": print("Your name is either John or Rick.") # in operator #The "in" operator co...
20.5625
124
0.612462
x=2 print(x == 2) print(x == 3) print(x<3) name = "John" age = 23 if name == "John" and age == 23: print("Your name is John, and you are also 23 years old.") if name == "John" or name == "Rick": print("Your name is either John or Rick.") mylist=["John","Rick"] if name in mylist: pri...
true
true
f7054235a1553c55fbb86f3ddd8de322b7a8e454
1,157
py
Python
mangaloid_instance/storage/models/chapter.py
compscifag/instance
449217abcab48cf3bbbb99ed2be9fcfacf2fa92f
[ "MIT" ]
null
null
null
mangaloid_instance/storage/models/chapter.py
compscifag/instance
449217abcab48cf3bbbb99ed2be9fcfacf2fa92f
[ "MIT" ]
null
null
null
mangaloid_instance/storage/models/chapter.py
compscifag/instance
449217abcab48cf3bbbb99ed2be9fcfacf2fa92f
[ "MIT" ]
null
null
null
from . import Base from sqlalchemy import Column, Integer, Text, DateTime, ForeignKey from datetime import datetime class Chapter(Base): __tablename__ = "chapters" id = Column(Integer, primary_key=True, autoincrement=True) manga_id = Column(Integer, ForeignKey("manga.id")) chapter_no = Column(Integer)...
33.057143
66
0.615385
from . import Base from sqlalchemy import Column, Integer, Text, DateTime, ForeignKey from datetime import datetime class Chapter(Base): __tablename__ = "chapters" id = Column(Integer, primary_key=True, autoincrement=True) manga_id = Column(Integer, ForeignKey("manga.id")) chapter_no = Column(Integer)...
true
true
f70543a92105e9ffaab879256ddfee6d1ffc3133
789
py
Python
app/plugins/task/command.py
criticallycode/zima
cd38cac1c0c33b362d110ae28deba3828daa3f4a
[ "Apache-2.0" ]
null
null
null
app/plugins/task/command.py
criticallycode/zima
cd38cac1c0c33b362d110ae28deba3828daa3f4a
[ "Apache-2.0" ]
null
null
null
app/plugins/task/command.py
criticallycode/zima
cd38cac1c0c33b362d110ae28deba3828daa3f4a
[ "Apache-2.0" ]
null
null
null
from systems.plugins.index import BaseProvider import re import shlex class Provider(BaseProvider('task', 'command')): def execute(self, results, params): env = self._env_vars(params) stdin = params.pop('input', self.field_input) cwd = params.pop('cwd', self.field_cwd) display = ...
28.178571
82
0.603295
from systems.plugins.index import BaseProvider import re import shlex class Provider(BaseProvider('task', 'command')): def execute(self, results, params): env = self._env_vars(params) stdin = params.pop('input', self.field_input) cwd = params.pop('cwd', self.field_cwd) display = ...
true
true
f70543b92bf5c3f32227c1e22d912116c437eda4
10,459
py
Python
kolibri/utils/tests/test_cli.py
FollonSaxBass/kolibri
4cf820b14386aecc228fecff64c847bad407cbb1
[ "MIT" ]
2
2021-05-13T10:20:46.000Z
2021-11-15T12:31:03.000Z
kolibri/utils/tests/test_cli.py
camellia26/kolibri
7f1cb794c93f37e039be22f56a5ac1989ed22bde
[ "MIT" ]
2
2021-09-24T11:36:21.000Z
2021-09-29T16:09:25.000Z
kolibri/utils/tests/test_cli.py
camellia26/kolibri
7f1cb794c93f37e039be22f56a5ac1989ed22bde
[ "MIT" ]
null
null
null
""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function import logging import os import tempfile import pytest from django.db.utils import OperationalError from mock import patch import kolibri from kolibri.plugins.utils import autoremove_unavailable...
32.582555
96
0.707716
from __future__ import absolute_import from __future__ import print_function import logging import os import tempfile import pytest from django.db.utils import OperationalError from mock import patch import kolibri from kolibri.plugins.utils import autoremove_unavailable_plugins from kolibri.utils import cli from ko...
true
true
f70544b0ddc04df283be747eb408cbc27a54108d
284
py
Python
Basic-Python/code/test_magic/3.py
johnnynode/AI-LEARNING-MATERIAL
1719f5b6ecb9b9caf485b9d806c1211b142b8ed5
[ "MIT" ]
2
2018-06-08T00:40:17.000Z
2018-06-08T05:27:30.000Z
Basic-Python/code/test_magic/3.py
johnnynode/AI-LEARNING-MATERIAL
1719f5b6ecb9b9caf485b9d806c1211b142b8ed5
[ "MIT" ]
null
null
null
Basic-Python/code/test_magic/3.py
johnnynode/AI-LEARNING-MATERIAL
1719f5b6ecb9b9caf485b9d806c1211b142b8ed5
[ "MIT" ]
null
null
null
class Person: name='zhangsan' age=20 p = Person() print(p) # <__main__.Person object at 0x10073e668> print('⭐️ ' * 20) class Stu: name='zhangsan' age=20 def __str__(self): return "name: %s; age: %d"%(self.name, self.age) s = Stu() print(s) # name: zhangsan; age: 20
15.777778
52
0.623239
class Person: name='zhangsan' age=20 p = Person() print(p) print('⭐️ ' * 20) class Stu: name='zhangsan' age=20 def __str__(self): return "name: %s; age: %d"%(self.name, self.age) s = Stu() print(s)
true
true
f70544f6140f506ebae794b51d635f46a4f446d2
3,088
py
Python
src/layers/transformers/sublayers.py
DwaraknathT/sparsity
705f2cba074e6ab4f7655c6af98882773cd826bf
[ "MIT" ]
null
null
null
src/layers/transformers/sublayers.py
DwaraknathT/sparsity
705f2cba074e6ab4f7655c6af98882773cd826bf
[ "MIT" ]
null
null
null
src/layers/transformers/sublayers.py
DwaraknathT/sparsity
705f2cba074e6ab4f7655c6af98882773cd826bf
[ "MIT" ]
null
null
null
""" Define the sublayers in encoder/decoder layer """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() se...
31.191919
96
0.599093
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature def forward(self, q, k, v, mask=None): attn ...
true
true
f705463c73b3b08df3a5efe1d09bfeb5a1f30dce
33,830
py
Python
StdChal.py
pzread/judge
9721caff6bda5c9d35edb581c060606824fad6d8
[ "MIT" ]
25
2015-03-14T08:13:22.000Z
2020-07-30T15:34:34.000Z
StdChal.py
pzread/judge
9721caff6bda5c9d35edb581c060606824fad6d8
[ "MIT" ]
32
2016-02-16T08:38:52.000Z
2016-08-18T08:12:15.000Z
StdChal.py
pzread/judge
9721caff6bda5c9d35edb581c060606824fad6d8
[ "MIT" ]
8
2015-10-14T10:27:21.000Z
2020-08-01T17:11:20.000Z
'''Standard challenge module.''' import os import shutil import fcntl from cffi import FFI from tornado import gen, concurrent, process from tornado.stack_context import StackContext from tornado.ioloop import IOLoop import PyExt import Privilege import Config from Utils import FileUtils STATUS_NONE = 0 STATUS_AC = ...
31.179724
80
0.532131
import os import shutil import fcntl from cffi import FFI from tornado import gen, concurrent, process from tornado.stack_context import StackContext from tornado.ioloop import IOLoop import PyExt import Privilege import Config from Utils import FileUtils STATUS_NONE = 0 STATUS_AC = 1 STATUS_WA = 2 STATUS_RE = 3 STA...
true
true
f70546cdac654426bc6a1c1eda3b202298692492
170
py
Python
Python/CodeForces Solutions/1-500/337A.py
7namansharma/Comp-Prog
b760ef9b4173e6d5851dc63cc92a8e935baf60ed
[ "MIT" ]
null
null
null
Python/CodeForces Solutions/1-500/337A.py
7namansharma/Comp-Prog
b760ef9b4173e6d5851dc63cc92a8e935baf60ed
[ "MIT" ]
null
null
null
Python/CodeForces Solutions/1-500/337A.py
7namansharma/Comp-Prog
b760ef9b4173e6d5851dc63cc92a8e935baf60ed
[ "MIT" ]
null
null
null
n, m = map(int, input().split()) l = list(map(int, input().split())) l.sort() mini = l[m-1] - l[0] for i in range(m-n+1): mini = min(mini, l[i+n-1]-l[i]) print(mini)
21.25
35
0.547059
n, m = map(int, input().split()) l = list(map(int, input().split())) l.sort() mini = l[m-1] - l[0] for i in range(m-n+1): mini = min(mini, l[i+n-1]-l[i]) print(mini)
true
true
f705476175ce0e41b026038bb632673a3821a6ce
13,531
py
Python
ivy/functional/ivy/linear_algebra.py
Neel-Renavikar/ivy
644ab189a3a3fc52b1f3f86563226106e549eea3
[ "Apache-2.0" ]
null
null
null
ivy/functional/ivy/linear_algebra.py
Neel-Renavikar/ivy
644ab189a3a3fc52b1f3f86563226106e549eea3
[ "Apache-2.0" ]
null
null
null
ivy/functional/ivy/linear_algebra.py
Neel-Renavikar/ivy
644ab189a3a3fc52b1f3f86563226106e549eea3
[ "Apache-2.0" ]
null
null
null
# global from typing import Union, Optional, Tuple, Literal from collections import namedtuple # local import ivy from ivy.framework_handler import current_framework as _cur_framework inf = float('inf') # Array API Standard # # -------------------# def matrix_transpose(x: Union[ivy.Array, ivy.NativeArray])\ ...
44.953488
483
0.578302
from typing import Union, Optional, Tuple, Literal from collections import namedtuple import ivy from ivy.framework_handler import current_framework as _cur_framework inf = float('inf') def matrix_transpose(x: Union[ivy.Array, ivy.NativeArray])\ -> ivy.Array: return _cur_framework(x).matrix_transpose(...
true
true
f70547e8199382ef401382f89593188a5674649a
1,195
py
Python
backend/surfsara/models/task.py
sara-nl/data-exchange
52b9c2554a52b56686f3a06f583a7a6454bf6df6
[ "Apache-2.0" ]
4
2020-12-03T14:13:29.000Z
2021-04-19T03:03:19.000Z
backend/surfsara/models/task.py
sara-nl/data-exchange
52b9c2554a52b56686f3a06f583a7a6454bf6df6
[ "Apache-2.0" ]
null
null
null
backend/surfsara/models/task.py
sara-nl/data-exchange
52b9c2554a52b56686f3a06f583a7a6454bf6df6
[ "Apache-2.0" ]
null
null
null
from django.contrib.postgres.fields import JSONField from django.db import models from surfsara.models.permission import Permission class Task(models.Model): RUNNING = "running" SUCCESS = "success" ERROR = "error" OUTPUT_RELEASED = "output_released" RELEASE_REJECTED = "release_rejected" TASK_...
34.142857
84
0.711297
from django.contrib.postgres.fields import JSONField from django.db import models from surfsara.models.permission import Permission class Task(models.Model): RUNNING = "running" SUCCESS = "success" ERROR = "error" OUTPUT_RELEASED = "output_released" RELEASE_REJECTED = "release_rejected" TASK_...
true
true
f705482cb111e6ec8cc98d518959f511b2ffb01f
4,422
py
Python
AtomicASTChangeMining/src/test/resources/ASTConversion/sklearn/utils/tests/test_seq_dataset.py
maldil/CPATMiner2.0
743aa8a5b638a1963e621f59f63d794728ab0c79
[ "Apache-2.0" ]
4
2021-11-04T02:47:31.000Z
2022-01-25T02:04:05.000Z
AtomicASTChangeMining/src/test/resources/ASTConversion/sklearn/utils/tests/test_seq_dataset.py
maldil/R-CPATMiner
88b96a5af438a9c2ea2dab351cb8b210119132a2
[ "Apache-2.0" ]
null
null
null
AtomicASTChangeMining/src/test/resources/ASTConversion/sklearn/utils/tests/test_seq_dataset.py
maldil/R-CPATMiner
88b96a5af438a9c2ea2dab351cb8b210119132a2
[ "Apache-2.0" ]
1
2021-09-11T06:52:39.000Z
2021-09-11T06:52:39.000Z
# Author: Tom Dupre la Tour # Joan Massich <mailsik@gmail.com> # # License: BSD 3 clause import numpy as np import pytest import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils._seq_dataset import ( ArrayDataset32, ArrayDataset64, CSRDataset32, CSRDataset64) from sklearn...
31.361702
79
0.688602
import numpy as np import pytest import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils._seq_dataset import ( ArrayDataset32, ArrayDataset64, CSRDataset32, CSRDataset64) from sklearn.datasets import load_iris from sklearn.utils._testing import assert_allclose iris = load_ir...
true
true
f705483d25bdc6d0944fd7a8786d200878fbb456
6,799
py
Python
registry.py
redheads/registry-image-check
989b676b0159607dc51fc7fbc010d56fdd4a197c
[ "Apache-2.0" ]
null
null
null
registry.py
redheads/registry-image-check
989b676b0159607dc51fc7fbc010d56fdd4a197c
[ "Apache-2.0" ]
null
null
null
registry.py
redheads/registry-image-check
989b676b0159607dc51fc7fbc010d56fdd4a197c
[ "Apache-2.0" ]
1
2021-04-23T13:01:11.000Z
2021-04-23T13:01:11.000Z
#!/usr/bin/env python # -*- coding:utf-8 -*- # bug-report: feilengcui008@gmail.com """ api for docker registry """ import urllib2 import urllib import json import base64 class RegistryException(Exception): """ registry api related exception """ pass class RegistryApi(object): """ interact with docker ...
40.712575
94
0.610531
import urllib2 import urllib import json import base64 class RegistryException(Exception): pass class RegistryApi(object): def __init__(self, username, password, registry_endpoint): self.username = username self.password = password self.basic_token = base64.encodestring("%s:%s" ...
true
true
f70548590f17b2348d1c6961c358ea744b865263
2,283
py
Python
src/examples/vision/image_classification_camera.py
SanchitMisal/aiyprojects-raspbian
d148b2b4f427cd6ed240f338f260f277ead50264
[ "Apache-2.0" ]
1,610
2017-05-04T13:41:19.000Z
2022-03-31T14:55:55.000Z
src/examples/vision/image_classification_camera.py
SanchitMisal/aiyprojects-raspbian
d148b2b4f427cd6ed240f338f260f277ead50264
[ "Apache-2.0" ]
716
2017-05-04T13:37:27.000Z
2022-03-04T09:42:48.000Z
src/examples/vision/image_classification_camera.py
SanchitMisal/aiyprojects-raspbian
d148b2b4f427cd6ed240f338f260f277ead50264
[ "Apache-2.0" ]
761
2017-05-04T16:00:31.000Z
2022-03-27T23:18:46.000Z
#!/usr/bin/env python3 # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
35.123077
90
0.710907
import argparse import contextlib from aiy.vision.inference import CameraInference from aiy.vision.models import image_classification from picamera import PiCamera def classes_info(classes): return ', '.join('%s (%.2f)' % pair for pair in classes) @contextlib.contextmanager def CameraPreview(camer...
true
true
f70549113c4375b6a845661be245774cf999e7fa
1,084
py
Python
py/server/deephaven/config/__init__.py
mattrunyon/deephaven-core
80e3567e4647ab76a81e483d0a8ab542f9aadace
[ "MIT" ]
null
null
null
py/server/deephaven/config/__init__.py
mattrunyon/deephaven-core
80e3567e4647ab76a81e483d0a8ab542f9aadace
[ "MIT" ]
null
null
null
py/server/deephaven/config/__init__.py
mattrunyon/deephaven-core
80e3567e4647ab76a81e483d0a8ab542f9aadace
[ "MIT" ]
null
null
null
# # Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending # """ This module provides access to the Deephaven server configuration. """ import jpy from deephaven import DHError from deephaven.time import TimeZone _JDHConfig = jpy.get_type("io.deephaven.configuration.Configuration") _JDateTimeZone = jpy.get_...
33.875
93
0.694649
import jpy from deephaven import DHError from deephaven.time import TimeZone _JDHConfig = jpy.get_type("io.deephaven.configuration.Configuration") _JDateTimeZone = jpy.get_type("org.joda.time.DateTimeZone") def get_log_dir() -> str: try: return _JDHConfig.getInstance().getLogDir() except Exceptio...
true
true
f70549e63137bea31c0367034d4cf81c7cef6244
19,148
py
Python
train/new_model_trainers/img_only.py
veritas9872/fastMRI-kspace
4c484b3183e9f06838b5ee108af283611c2e1e77
[ "MIT" ]
18
2019-10-21T23:54:28.000Z
2021-12-23T08:16:04.000Z
train/new_model_trainers/img_only.py
veritas9872/fastMRI-kspace
4c484b3183e9f06838b5ee108af283611c2e1e77
[ "MIT" ]
1
2020-07-11T08:05:33.000Z
2020-07-11T08:05:33.000Z
train/new_model_trainers/img_only.py
veritas9872/fastMRI-kspace
4c484b3183e9f06838b5ee108af283611c2e1e77
[ "MIT" ]
5
2019-11-23T14:11:54.000Z
2022-02-19T13:39:15.000Z
import torch from torch import nn, optim, multiprocessing from torch.utils.data import DataLoader from torch.utils.tensorboard.writer import SummaryWriter from tqdm import tqdm from time import time from collections import defaultdict from utils.run_utils import get_logger from utils.train_utils import CheckpointMan...
49.606218
120
0.652966
import torch from torch import nn, optim, multiprocessing from torch.utils.data import DataLoader from torch.utils.tensorboard.writer import SummaryWriter from tqdm import tqdm from time import time from collections import defaultdict from utils.run_utils import get_logger from utils.train_utils import CheckpointMan...
true
true
f7054b7e595f0681a798e1fedadc7b43405ebf05
2,576
py
Python
interpreter.py
bdngo/math-interpreter-py
fadcefce82176adf38722f7005270d6f2ea6957d
[ "MIT" ]
null
null
null
interpreter.py
bdngo/math-interpreter-py
fadcefce82176adf38722f7005270d6f2ea6957d
[ "MIT" ]
null
null
null
interpreter.py
bdngo/math-interpreter-py
fadcefce82176adf38722f7005270d6f2ea6957d
[ "MIT" ]
null
null
null
from nodes import * from tokens import Token, TokenType class Interpreter: def __init__(self, ast): self.ast = ast def eval(self): return self.evalHelper(self.ast) def evalHelper(self, ast): if isinstance(ast, NumberNode): return ast.node elif isinstance(ast, ...
37.333333
77
0.574534
from nodes import * from tokens import Token, TokenType class Interpreter: def __init__(self, ast): self.ast = ast def eval(self): return self.evalHelper(self.ast) def evalHelper(self, ast): if isinstance(ast, NumberNode): return ast.node elif isinstance(ast, ...
true
true
f7054bb2d5a141238c03843e494f10f7a429bc1b
3,634
py
Python
upload/common/batch.py
sampierson/upload-service
b7c470706f729bdee34a4254555f798558877095
[ "MIT" ]
6
2018-01-31T19:44:17.000Z
2020-02-20T13:03:09.000Z
upload/common/batch.py
sampierson/upload-service
b7c470706f729bdee34a4254555f798558877095
[ "MIT" ]
379
2018-03-21T21:29:15.000Z
2020-01-28T14:20:48.000Z
upload/common/batch.py
HumanCellAtlas/staging-service
b7c470706f729bdee34a4254555f798558877095
[ "MIT" ]
5
2018-03-09T14:13:15.000Z
2020-01-30T15:49:46.000Z
import hashlib import json import os import boto3 from .retry import retry_on_aws_too_many_requests batch = boto3.client('batch') class JobDefinition: @classmethod def clear_all(cls): deleted_count = 0 for jobdef in batch.describe_job_definitions(status='ACTIVE')['jobDefinitions']: ...
35.627451
112
0.581728
import hashlib import json import os import boto3 from .retry import retry_on_aws_too_many_requests batch = boto3.client('batch') class JobDefinition: @classmethod def clear_all(cls): deleted_count = 0 for jobdef in batch.describe_job_definitions(status='ACTIVE')['jobDefinitions']: ...
true
true
f7054c9560ffb857b2249248031a041e8e79b6b8
143
py
Python
02-Data_Types_and_Variables/Exercises/4-Sum_of_Chars.py
eclipse-ib/Software-University-Fundamentals_Module
994ef75c70d1bae8e615dbb789aeffd6e0a42c34
[ "MIT" ]
null
null
null
02-Data_Types_and_Variables/Exercises/4-Sum_of_Chars.py
eclipse-ib/Software-University-Fundamentals_Module
994ef75c70d1bae8e615dbb789aeffd6e0a42c34
[ "MIT" ]
null
null
null
02-Data_Types_and_Variables/Exercises/4-Sum_of_Chars.py
eclipse-ib/Software-University-Fundamentals_Module
994ef75c70d1bae8e615dbb789aeffd6e0a42c34
[ "MIT" ]
null
null
null
n = int(input()) total_sum = 0 for i in range(1,n+1): letter = input() total_sum += ord(letter) print(f"The sum equals: {total_sum}")
17.875
37
0.622378
n = int(input()) total_sum = 0 for i in range(1,n+1): letter = input() total_sum += ord(letter) print(f"The sum equals: {total_sum}")
true
true
f7054ddd1c29f5074a0fb83fe4035a51a2b1d6f7
24,926
py
Python
python/ccxt/wazirx.py
jspenc72/ccxt
5eb43754ddb85aa24fb16860ce80d18790c288be
[ "MIT" ]
null
null
null
python/ccxt/wazirx.py
jspenc72/ccxt
5eb43754ddb85aa24fb16860ce80d18790c288be
[ "MIT" ]
1
2022-01-27T19:54:13.000Z
2022-01-27T19:54:13.000Z
python/ccxt/wazirx.py
jspenc72/ccxt
5eb43754ddb85aa24fb16860ce80d18790c288be
[ "MIT" ]
1
2022-03-15T22:51:08.000Z
2022-03-15T22:51:08.000Z
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors import PermissionDe...
36.872781
160
0.46618
ge import Exchange import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors import PermissionDenied from ccxt.base.errors import ArgumentsRequired from ccxt.base.errors import BadRequest from ccxt.base.errors import BadSymbol from ccxt.base.errors import InsufficientFunds from ccxt.base.errors...
true
true
f7054e9b703e0a50932a707ef947c70e5aed0d9c
1,295
py
Python
bin/MemoryRuns.py
seanluciotolentino/SimpactPurple
a81a738bd63bc1d6a86f7243c0826f6e5d846447
[ "AFL-3.0" ]
null
null
null
bin/MemoryRuns.py
seanluciotolentino/SimpactPurple
a81a738bd63bc1d6a86f7243c0826f6e5d846447
[ "AFL-3.0" ]
null
null
null
bin/MemoryRuns.py
seanluciotolentino/SimpactPurple
a81a738bd63bc1d6a86f7243c0826f6e5d846447
[ "AFL-3.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Wed Oct 23 14:16:27 2013 @author: Lucio Program for assessing the memory footprint of the simulation. Needs the memory_profiler module (installed on the milano cluster). """ import os import time import sys import simpactpurple from memory_profiler import profile @profile de...
27.553191
76
0.674131
import os import time import sys import simpactpurple from memory_profiler import profile @profile def run_single(pop): s = simpactpurple.Community() s.INITIAL_POPULATION = pop s.start() s.update_recruiting(s.RECRUIT_INITIAL) for i in range(s.RECRUIT_WARM_UP): s.tim...
true
true
f7054fb9122add1a551c527b03a0139ed75b600b
416
py
Python
aserializer/django/utils.py
orderbird/aserializer
3aeaa073f2dac7830458a1f45ffa9af6540bd315
[ "MIT" ]
null
null
null
aserializer/django/utils.py
orderbird/aserializer
3aeaa073f2dac7830458a1f45ffa9af6540bd315
[ "MIT" ]
null
null
null
aserializer/django/utils.py
orderbird/aserializer
3aeaa073f2dac7830458a1f45ffa9af6540bd315
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- try: import django except ImportError as e: django = None django_import_error = e def check_django_import(): if django is None: raise django_import_error class django_required(object): def __call__(self, func): def wrapper(self, *args, **kwargs): ...
19.809524
46
0.625
try: import django except ImportError as e: django = None django_import_error = e def check_django_import(): if django is None: raise django_import_error class django_required(object): def __call__(self, func): def wrapper(self, *args, **kwargs): check_django_import...
true
true
f705510f848be122cef73d6a694e14dd0d464839
111,947
py
Python
python/paddle/tensor/math.py
LemonNoel/Paddle
1cb511d1488bb86ebb587330902840cb01c79c0d
[ "Apache-2.0" ]
null
null
null
python/paddle/tensor/math.py
LemonNoel/Paddle
1cb511d1488bb86ebb587330902840cb01c79c0d
[ "Apache-2.0" ]
null
null
null
python/paddle/tensor/math.py
LemonNoel/Paddle
1cb511d1488bb86ebb587330902840cb01c79c0d
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
37.253577
291
0.570993
from __future__ import print_function import numpy as np from paddle.common_ops_import import VarDesc from paddle.common_ops_import import dygraph_only from paddle.common_ops_import import OpProtoHolder from paddle.common_ops_import import templatedoc from paddle.common_ops_import import dygraph_utils fr...
true
true
f7055160e64b5e5b19261e32e1da4a104c9c3cab
3,748
py
Python
airtest/core/android/javacap.py
koyoki/Airtest
ea8391bd4819d9231e7b35f18c14662e6109fad0
[ "Apache-2.0" ]
2
2019-12-10T02:36:49.000Z
2019-12-19T08:54:40.000Z
airtest/core/android/javacap.py
koyoki/Airtest
ea8391bd4819d9231e7b35f18c14662e6109fad0
[ "Apache-2.0" ]
1
2021-10-12T22:51:23.000Z
2021-10-12T22:51:23.000Z
airtest/core/android/javacap.py
koyoki/Airtest
ea8391bd4819d9231e7b35f18c14662e6109fad0
[ "Apache-2.0" ]
1
2020-12-07T03:40:41.000Z
2020-12-07T03:40:41.000Z
# -*- coding: utf-8 -*- from airtest.utils.logger import get_logger from airtest.utils.safesocket import SafeSocket from airtest.utils.nbsp import NonBlockingStreamReader from airtest.utils.snippet import on_method_ready, reg_cleanup from airtest.core.android.yosemite import Yosemite import struct LOGGING = get_logger(...
31.233333
119
0.583511
from airtest.utils.logger import get_logger from airtest.utils.safesocket import SafeSocket from airtest.utils.nbsp import NonBlockingStreamReader from airtest.utils.snippet import on_method_ready, reg_cleanup from airtest.core.android.yosemite import Yosemite import struct LOGGING = get_logger(__name__) class Javac...
true
true
f705525314573327c75262120641f8403420919a
8,991
py
Python
447.number-of-boomerangs.py
windard/leeeeee
0107a5f95746592ca4fe78d2b5875cf65b1910e7
[ "MIT" ]
null
null
null
447.number-of-boomerangs.py
windard/leeeeee
0107a5f95746592ca4fe78d2b5875cf65b1910e7
[ "MIT" ]
null
null
null
447.number-of-boomerangs.py
windard/leeeeee
0107a5f95746592ca4fe78d2b5875cf65b1910e7
[ "MIT" ]
null
null
null
# # @lc app=leetcode id=447 lang=python # # [447] Number of Boomerangs # # https://leetcode.com/problems/number-of-boomerangs/description/ # # algorithms # Easy (49.20%) # Likes: 296 # Dislikes: 447 # Total Accepted: 54.7K # Total Submissions: 109.6K # Testcase Example: '[[0,0],[1,0],[2,0]]' # # Given n points i...
96.677419
6,179
0.590034
import math class Solution(object): def _numberOfBoomerangs(self, points): result = [] distance = [[0] * len(points) for _ in range(len(points))] for i in range(len(points)): for j in range(i): distance[i][j] = (po...
true
true
f705538bc3b669ad295f2e7b446dda5111b30b7a
4,216
py
Python
recipes/libtiff/all/conanfile.py
AlexandreBossard/conan-center-index
6f89ce09b20795129b5ef63568a0a458b3d388ec
[ "MIT" ]
null
null
null
recipes/libtiff/all/conanfile.py
AlexandreBossard/conan-center-index
6f89ce09b20795129b5ef63568a0a458b3d388ec
[ "MIT" ]
1
2019-11-26T10:55:31.000Z
2019-11-26T10:55:31.000Z
recipes/libtiff/all/conanfile.py
AlexandreBossard/conan-center-index
6f89ce09b20795129b5ef63568a0a458b3d388ec
[ "MIT" ]
1
2019-10-31T19:29:14.000Z
2019-10-31T19:29:14.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake, tools import os import shutil class LibtiffConan(ConanFile): name = "libtiff" description = "Library for Tag Image File Format (TIFF)" url = "https://github.com/conan-io/conan-center-index" author = "Bincrafters <bincr...
47.909091
127
0.624526
from conans import ConanFile, CMake, tools import os import shutil class LibtiffConan(ConanFile): name = "libtiff" description = "Library for Tag Image File Format (TIFF)" url = "https://github.com/conan-io/conan-center-index" author = "Bincrafters <bincrafters@gmail.com>" license = "MIT" h...
true
true