hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3f95a51251d4cf6c48c3abb5bd40665ab2c61e | 4,984 | py | Python | bcbio/pipeline/fastq.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | null | null | null | bcbio/pipeline/fastq.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | null | null | null | bcbio/pipeline/fastq.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | null | null | null | """Pipeline utilities to retrieve FASTQ formatted files for processing.
"""
import os
import sys
from bcbio import bam, broad, utils
from bcbio.bam import fastq
from bcbio.bam import cram
from bcbio.pipeline import alignment
from bcbio.utils import file_exists, safe_makedir, splitext_plus
from bcbio.provenance import ... | 41.190083 | 88 | 0.642055 | import os
import sys
from bcbio import bam, broad, utils
from bcbio.bam import fastq
from bcbio.bam import cram
from bcbio.pipeline import alignment
from bcbio.utils import file_exists, safe_makedir, splitext_plus
from bcbio.provenance import do
from bcbio.distributed.transaction import file_transaction
def get_fast... | true | true |
1c3f95a83bc3368b846edc6e57fe656d9a2c100c | 5,821 | py | Python | rocket_soc/lib/templates/lut-gamma-application/filter-image.py | PACO-CPU/rocket-soc | 34e10472a51830669bae3635dae6d52b8b41426d | [
"BSD-2-Clause"
] | 2 | 2017-08-11T13:15:02.000Z | 2019-01-15T10:10:58.000Z | rocket_soc/lib/templates/lut-gamma-application/filter-image.py | PACO-CPU/rocket-soc | 34e10472a51830669bae3635dae6d52b8b41426d | [
"BSD-2-Clause"
] | null | null | null | rocket_soc/lib/templates/lut-gamma-application/filter-image.py | PACO-CPU/rocket-soc | 34e10472a51830669bae3635dae6d52b8b41426d | [
"BSD-2-Clause"
] | 3 | 2019-01-15T10:11:00.000Z | 2020-10-14T18:18:01.000Z | #!/usr/bin/env python3
import sys
import time
import struct
import os.path
import serial
import threading
import re
import subprocess
from paco import util
from PIL import Image
port="/dev/ttyUSB0"
baud=115200
fRunRocket=False
fRunPython=False
filenames=[]
def print_help(f):
f.write(
"filter-image.py [options]... | 23.37751 | 83 | 0.606769 | import sys
import time
import struct
import os.path
import serial
import threading
import re
import subprocess
from paco import util
from PIL import Image
port="/dev/ttyUSB0"
baud=115200
fRunRocket=False
fRunPython=False
filenames=[]
def print_help(f):
f.write(
"filter-image.py [options] file1 [file2 ...]\n"
... | true | true |
1c3f95b5f09f03b747ec1fdd2b7a742a398b2bbc | 429 | py | Python | Giraffe/If statement.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | Giraffe/If statement.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | Giraffe/If statement.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | 1 | 2022-01-14T17:12:44.000Z | 2022-01-14T17:12:44.000Z | is_male = True
is_tall = True
if is_male or is_tall:
print("You are a male or tall or both")
else:
print("You are neither male no tall")
is_male = False
is_tall = False
if is_male and is_tall:
print("You are a tall male")
elif is_male and not(is_tall):
print("You are a short male")
elif is_male and... | 20.428571 | 44 | 0.685315 | is_male = True
is_tall = True
if is_male or is_tall:
print("You are a male or tall or both")
else:
print("You are neither male no tall")
is_male = False
is_tall = False
if is_male and is_tall:
print("You are a tall male")
elif is_male and not(is_tall):
print("You are a short male")
elif is_male and... | true | true |
1c3f95e1775b02a01e699032453673f89db1bf1a | 31,415 | py | Python | geopandas/tests/test_plotting.py | schilli/geopandas | 29add0a735b00dc20c79e0fccc8e6a775c4997b0 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T09:00:54.000Z | 2022-01-12T09:00:54.000Z | geopandas/tests/test_plotting.py | samuelduchesne/geopandas | 29add0a735b00dc20c79e0fccc8e6a775c4997b0 | [
"BSD-3-Clause"
] | null | null | null | geopandas/tests/test_plotting.py | samuelduchesne/geopandas | 29add0a735b00dc20c79e0fccc8e6a775c4997b0 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division
import itertools
import warnings
import numpy as np
from shapely.affinity import rotate
from shapely.geometry import MultiPolygon, Polygon, LineString, Point, MultiPoint
from geopandas import GeoSeries, GeoDataFrame, read_file
from geopandas.datasets import get_path
... | 39.367168 | 88 | 0.607831 | from __future__ import absolute_import, division
import itertools
import warnings
import numpy as np
from shapely.affinity import rotate
from shapely.geometry import MultiPolygon, Polygon, LineString, Point, MultiPoint
from geopandas import GeoSeries, GeoDataFrame, read_file
from geopandas.datasets import get_path
... | true | true |
1c3f95fa312334189873cf27fbc1e290bd179dc9 | 22,964 | py | Python | neurips2019/hgnn_composer.py | SunHaozhe/modular-metalearning | c94dd18c6d105f18667d4de7bb4c81fa538a541c | [
"MIT"
] | 70 | 2018-10-30T01:05:43.000Z | 2022-02-11T04:08:19.000Z | neurips2019/hgnn_composer.py | SunHaozhe/modular-metalearning | c94dd18c6d105f18667d4de7bb4c81fa538a541c | [
"MIT"
] | 7 | 2019-03-25T17:14:22.000Z | 2021-06-11T11:57:22.000Z | neurips2019/hgnn_composer.py | SunHaozhe/modular-metalearning | c94dd18c6d105f18667d4de7bb4c81fa538a541c | [
"MIT"
] | 12 | 2019-01-27T01:14:16.000Z | 2021-10-05T17:47:19.000Z | from __future__ import print_function
import copy
import numpy as np
import torch
from torch import nn
from composition import Composer
from structure import Structure
from tqdm import tqdm as Tqdm
import json
# import matplotlib.pyplot as plt
import os
import networkx as nx
# from torchviz import make_dot
from scipy.s... | 43.492424 | 112 | 0.661514 | from __future__ import print_function
import copy
import numpy as np
import torch
from torch import nn
from composition import Composer
from structure import Structure
from tqdm import tqdm as Tqdm
import json
import os
import networkx as nx
from scipy.stats import entropy
torch.set_default_tensor_type('torch.cuda.Floa... | true | true |
1c3f9641e3c27b495230081a66c93766d00145b8 | 15,089 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/results_bd0cbe4a54d59462bce70486b688621e.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/results_0e8c0f2566f300a755bc9b2735193666.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/results_9d6b50c703ce2587fc1f039c09570043.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 42.624294 | 729 | 0.629068 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class Results(Base):
__slots__ = ()
_SDM_NAME = 'results'
_SDM_ATT_MAP = {
'CurrentActions': 'currentActions',
'CurrentViews': 'currentViews',
'Duration': 'duration'... | true | true |
1c3f96648192ebf6e892f6aace58fee113c272a2 | 3,900 | py | Python | ankidict/addon/collection.py | wojtex/millandict | 6601873a1541ef7aaf938ac1a6b7aecb5f82cbf8 | [
"MIT"
] | 1 | 2015-10-15T19:04:05.000Z | 2015-10-15T19:04:05.000Z | ankidict/addon/collection.py | wojtex/ankidict | 6601873a1541ef7aaf938ac1a6b7aecb5f82cbf8 | [
"MIT"
] | 9 | 2015-03-24T08:06:51.000Z | 2015-05-21T13:44:10.000Z | ankidict/addon/collection.py | wojtex/ankidict | 6601873a1541ef7aaf938ac1a6b7aecb5f82cbf8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
####
# Copyright (c) 2014 Wojciech Kordalski
# Copyright (c) 2014 Franciszek Piszcz
#
# 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 w... | 30.952381 | 105 | 0.686667 |
from aqt import mw
import re
def get_plugin():
return mw.ankidict
def setup():
select_deck()
def select_deck():
self = get_plugin()
deckname = self.config.deck
deckid = mw.col.decks.id(deckname)
select_model()
m = mw.col.models.current()
m['did'] = deckid
mw.col.models.save(m)
def... | true | true |
1c3f979de1e38890393e0ca641ceec5d0d350d12 | 717 | py | Python | openstack_dashboard/dashboards/project/appdetail/tests.py | soma-micro-service/Horizon | 45243061b8a99935e0e483a314d95a82d33cc4cf | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/appdetail/tests.py | soma-micro-service/Horizon | 45243061b8a99935e0e483a314d95a82d33cc4cf | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/appdetail/tests.py | soma-micro-service/Horizon | 45243061b8a99935e0e483a314d95a82d33cc4cf | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 35.85 | 75 | 0.743375 |
from horizon.test import helpers as test
class AppdetailTests(test.TestCase):
def test_me(self):
self.assertTrue(1 + 1 == 2)
| true | true |
1c3f97ce62b9cf4a3d0b30e9a3ea4994c6c6751e | 939 | py | Python | play/shutdownSystem.py | Svolcano/python_exercise | a50e05891cc7f1fbb40ebcae324b09b6a14473d2 | [
"MIT"
] | 6 | 2015-07-09T08:47:08.000Z | 2020-05-16T10:47:31.000Z | play/shutdownSystem.py | Svolcano/python_exercise | a50e05891cc7f1fbb40ebcae324b09b6a14473d2 | [
"MIT"
] | 7 | 2019-03-27T04:13:12.000Z | 2022-03-02T14:54:56.000Z | play/shutdownSystem.py | Svolcano/python_exercise | a50e05891cc7f1fbb40ebcae324b09b6a14473d2 | [
"MIT"
] | 2 | 2019-06-21T06:46:28.000Z | 2019-12-23T09:31:09.000Z | #coding=utf-8
import time
from os import system
def shutdownSystem():
runing = True
while runing:
input_cmd = input('shutdown(s)reboot(r)?quit(q)')
input_cmd = input_cmd.lower()
if input_cmd == 'q' or input_cmd == 'quit':
runing = False
print ('byebye')
... | 28.454545 | 71 | 0.526092 | import time
from os import system
def shutdownSystem():
runing = True
while runing:
input_cmd = input('shutdown(s)reboot(r)?quit(q)')
input_cmd = input_cmd.lower()
if input_cmd == 'q' or input_cmd == 'quit':
runing = False
print ('byebye')
break
... | true | true |
1c3f9850d2bddf85fd1ad2831f488a02393e90ab | 1,513 | py | Python | genie/mafSP.py | kdaily/Genie | e2ff86938a9cdc9fc0415d4447d68762333b0cea | [
"MIT"
] | null | null | null | genie/mafSP.py | kdaily/Genie | e2ff86938a9cdc9fc0415d4447d68762333b0cea | [
"MIT"
] | 1 | 2020-02-12T19:09:03.000Z | 2020-09-18T22:23:34.000Z | genie/mafSP.py | kdaily/Genie | e2ff86938a9cdc9fc0415d4447d68762333b0cea | [
"MIT"
] | 1 | 2019-08-30T23:16:26.000Z | 2019-08-30T23:16:26.000Z | from __future__ import absolute_import
from genie import maf, process_functions
import os
import logging
import pandas as pd
logger = logging.getLogger(__name__)
class mafSP(maf):
'''
MAF SP file format validation / processing
'''
_fileType = "mafSP"
def _validateFilename(self, filePath):
... | 30.877551 | 73 | 0.623265 | from __future__ import absolute_import
from genie import maf, process_functions
import os
import logging
import pandas as pd
logger = logging.getLogger(__name__)
class mafSP(maf):
_fileType = "mafSP"
def _validateFilename(self, filePath):
assert os.path.basename(filePath[0]) == \
"nonGEN... | true | true |
1c3f98c14fba98bd6f8af7e9419d91e0bdc2240d | 4,475 | py | Python | scripts/get_github_project_issues.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | null | null | null | scripts/get_github_project_issues.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | 268 | 2020-03-31T15:46:59.000Z | 2022-03-31T18:01:08.000Z | scripts/get_github_project_issues.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | 1 | 2021-01-05T01:58:24.000Z | 2021-01-05T01:58:24.000Z |
"""
This script uses GitHub APIs to fetch a list of issues associated with a project.
It outputs issue numbers and titles for all cards in all columns of the project.
The output is particularly useful for putting into the GitHub release notes.
You can store your github token in the settings.secret.yml file, if you wis... | 37.605042 | 129 | 0.682682 |
import requests
from requests.auth import HTTPBasicAuth
import json
import os
import yaml
import sys
import re
import getpass
import argparse
headers = {'Accept': 'application/vnd.github.inertia-preview+json'}
parser = argparse.ArgumentParser(description='Parse a .po file')
parser.add_argument('--column', help='the... | true | true |
1c3f9a7759248b86862afe650b24be7a650c7e82 | 24,653 | py | Python | tests/cli/commands/test_task_command.py | utkarsharma2/airflow | 52569ef1cf90554d1a8d119ecc9f8fd767653c2b | [
"Apache-2.0"
] | null | null | null | tests/cli/commands/test_task_command.py | utkarsharma2/airflow | 52569ef1cf90554d1a8d119ecc9f8fd767653c2b | [
"Apache-2.0"
] | null | null | null | tests/cli/commands/test_task_command.py | utkarsharma2/airflow | 52569ef1cf90554d1a8d119ecc9f8fd767653c2b | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 36.850523 | 109 | 0.593031 | import io
import json
import logging
import os
import re
import unittest
from argparse import ArgumentParser
from contextlib import redirect_stdout
from datetime import datetime
from unittest import mock
import pytest
from parameterized import parameterized
from airflow import DAG
from airflow.cli import cli_parser
f... | true | true |
1c3f9ba1ef528c098a499f8749bd5a92e3a1417d | 182,454 | py | Python | yt_dlp/YoutubeDL.py | ibook86/yt-dlp | 9a5b0125752179f6447ca29deb89ee452fd78b85 | [
"Unlicense"
] | null | null | null | yt_dlp/YoutubeDL.py | ibook86/yt-dlp | 9a5b0125752179f6447ca29deb89ee452fd78b85 | [
"Unlicense"
] | null | null | null | yt_dlp/YoutubeDL.py | ibook86/yt-dlp | 9a5b0125752179f6447ca29deb89ee452fd78b85 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import datetime
import errno
import fileinput
import functools
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
import shutil
imp... | 46.939542 | 140 | 0.571059 |
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import datetime
import errno
import fileinput
import functools
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
import shutil
import subprocess
import sys
import tempfi... | true | true |
1c3f9ceeccd755232226fb4d68b02dcf4d5fb914 | 2,764 | py | Python | lib/rucio/api/dirac.py | faluchet/rucio | b8f3ebdc0748aeed022d8b789e7ef6e0f36e6dae | [
"Apache-2.0"
] | null | null | null | lib/rucio/api/dirac.py | faluchet/rucio | b8f3ebdc0748aeed022d8b789e7ef6e0f36e6dae | [
"Apache-2.0"
] | null | null | null | lib/rucio/api/dirac.py | faluchet/rucio | b8f3ebdc0748aeed022d8b789e7ef6e0f36e6dae | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# 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-... | 41.253731 | 139 | 0.688495 |
from __future__ import print_function
from rucio.api.permission import has_permission
from rucio.api.scope import list_scopes
from rucio.core.rse import get_rse_id
from rucio.core import dirac
from rucio.common.exception import AccessDenied
from rucio.common.utils import extract_scope
def add_files(lfns, issuer, i... | true | true |
1c3f9e4ebd21ad0606f2ffec97ee9773ddb7352f | 6,398 | py | Python | sphinxcontrib/confluencebuilder/exceptions.py | tsvi/confluencebuilder | 8a7577d5ca3afa095276dbe1e6f35821beae3f23 | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/confluencebuilder/exceptions.py | tsvi/confluencebuilder | 8a7577d5ca3afa095276dbe1e6f35821beae3f23 | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/confluencebuilder/exceptions.py | tsvi/confluencebuilder | 8a7577d5ca3afa095276dbe1e6f35821beae3f23 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2017-2020 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from sphinx.errors import ConfigError
from sphinx.errors import SphinxError
class ConfluenceError(SphinxError):
category = 'sphinxcontrib.confluencebuilder error'
clas... | 37.857988 | 80 | 0.523914 |
from sphinx.errors import ConfigError
from sphinx.errors import SphinxError
class ConfluenceError(SphinxError):
category = 'sphinxcontrib.confluencebuilder error'
class ConfluenceAuthenticationFailedUrlError(ConfluenceError):
def __init__(self):
SphinxError.__init__(self,
"""---\n"""
... | true | true |
1c3f9e5aea4eb42fa74686213dd3f580aeda7d65 | 10,183 | py | Python | 2018-2019/project/utils/preprocessing.py | Tudor67/Neural-Networks-Assignments | 7376e9d3b0059df2f2b21d56787c47d3c1ba6746 | [
"MIT"
] | 1 | 2019-04-07T03:50:57.000Z | 2019-04-07T03:50:57.000Z | 2018-2019/project/utils/preprocessing.py | Tudor67/Neural-Networks-Assignments | 7376e9d3b0059df2f2b21d56787c47d3c1ba6746 | [
"MIT"
] | 5 | 2018-10-16T22:46:33.000Z | 2019-02-04T20:11:41.000Z | 2018-2019/project/utils/preprocessing.py | Tudor67/Neural-Networks-Assignments | 7376e9d3b0059df2f2b21d56787c47d3c1ba6746 | [
"MIT"
] | 1 | 2019-04-07T03:50:42.000Z | 2019-04-07T03:50:42.000Z | import numpy as np
import os
import skimage
import sys
def resize_images(images, new_h, new_w, ch):
resized_images = np.zeros([len(images), new_h, new_w, ch])
for idx, img in enumerate(images):
resized_images[idx] = skimage.transform.resize(img,
[n... | 41.060484 | 97 | 0.582343 | import numpy as np
import os
import skimage
import sys
def resize_images(images, new_h, new_w, ch):
resized_images = np.zeros([len(images), new_h, new_w, ch])
for idx, img in enumerate(images):
resized_images[idx] = skimage.transform.resize(img,
[n... | true | true |
1c3f9ecbc4cd49d29d84f283efcb137d3085b13f | 25,468 | py | Python | qa/rpc-tests/fundrawtransaction-hd.py | zevno/zevno-core | f546a48aaaf55c268633fcd8d04fc7c41c7b2bc8 | [
"MIT"
] | 1 | 2020-12-10T00:17:10.000Z | 2020-12-10T00:17:10.000Z | qa/rpc-tests/fundrawtransaction-hd.py | zevno/zevno-core | f546a48aaaf55c268633fcd8d04fc7c41c7b2bc8 | [
"MIT"
] | null | null | null | qa/rpc-tests/fundrawtransaction-hd.py | zevno/zevno-core | f546a48aaaf55c268633fcd8d04fc7c41c7b2bc8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... | 40.683706 | 214 | 0.558701 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class RawTransactionsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 4
def setup_network(self, split=False):
self... | true | true |
1c3f9fa719865326ced95a5c8076ae6f9ef8fd6c | 296 | py | Python | cartelisands/models.py | austing/cartels | bfb5c3c333cfcbf62c2d8a5850794a3235d2ff87 | [
"MIT"
] | null | null | null | cartelisands/models.py | austing/cartels | bfb5c3c333cfcbf62c2d8a5850794a3235d2ff87 | [
"MIT"
] | null | null | null | cartelisands/models.py | austing/cartels | bfb5c3c333cfcbf62c2d8a5850794a3235d2ff87 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django.contrib.gis.db.models import PointField
class Cartelisand(models.Model):
user = models.OneToOneField(User)
most_recent_place = PointField(blank=True, null=True)
| 29.6 | 57 | 0.807432 | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django.contrib.gis.db.models import PointField
class Cartelisand(models.Model):
user = models.OneToOneField(User)
most_recent_place = PointField(blank=True, null=True)
| true | true |
1c3fa04b967474e8b10e6fa7984f418a7281fc93 | 1,403 | py | Python | OrderSystem/utilities/Permissions.py | mattjt/OrderSystem | cbb433c1edb31527e77194d004cf408bd22a28ad | [
"MIT"
] | 1 | 2018-03-31T12:36:02.000Z | 2018-03-31T12:36:02.000Z | OrderSystem/utilities/Permissions.py | mattjt/OrderSystem | cbb433c1edb31527e77194d004cf408bd22a28ad | [
"MIT"
] | null | null | null | OrderSystem/utilities/Permissions.py | mattjt/OrderSystem | cbb433c1edb31527e77194d004cf408bd22a28ad | [
"MIT"
] | null | null | null | from functools import wraps
from flask import abort, redirect, url_for, request
from flask_login import current_user
def get_path():
return str(request.path).strip('/')
def admin_access_required(func):
@wraps(func)
def wrapper(*args, **kwargs):
if current_user.is_authenticated:
if c... | 27.509804 | 83 | 0.607983 | from functools import wraps
from flask import abort, redirect, url_for, request
from flask_login import current_user
def get_path():
return str(request.path).strip('/')
def admin_access_required(func):
@wraps(func)
def wrapper(*args, **kwargs):
if current_user.is_authenticated:
if c... | true | true |
1c3fa1697442963e61d94c3212fdaec06e8e6352 | 2,485 | py | Python | doctor/views.py | naitik2314/E-Health-Care | 246774d4abdc01d829effd58b6bebae947c9c9c5 | [
"MIT"
] | null | null | null | doctor/views.py | naitik2314/E-Health-Care | 246774d4abdc01d829effd58b6bebae947c9c9c5 | [
"MIT"
] | null | null | null | doctor/views.py | naitik2314/E-Health-Care | 246774d4abdc01d829effd58b6bebae947c9c9c5 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from doctor.models import DoctorInfo
from django.contrib import messages
from doctor.forms import UserForm
from django.db.models import Q
from django.contrib.auth.decorators import user_passes_test, login_required... | 35 | 180 | 0.696982 | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from doctor.models import DoctorInfo
from django.contrib import messages
from doctor.forms import UserForm
from django.db.models import Q
from django.contrib.auth.decorators import user_passes_test, login_required... | true | true |
1c3fa18e3a8be1afda0a727f003a3a985ab2d1d7 | 4,576 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_image_type.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_image_type.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_image_type.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | 28.246914 | 85 | 0.590691 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1ImageType(object):
openapi_types = {"name": "str", "connection": "str"}
attribute_map = {"name": "name", "connection": "connection"}
def __init__(
self, name=None, connection=None, local_vars_... | true | true |
1c3fa29f70d5302adfe320370e33ec19887b2f25 | 72 | py | Python | Testing Files/scheduler test.py | Butterparade/School-stuff | 0b92ca29c7c582727226bc18ac590a68d998f822 | [
"Apache-2.0"
] | null | null | null | Testing Files/scheduler test.py | Butterparade/School-stuff | 0b92ca29c7c582727226bc18ac590a68d998f822 | [
"Apache-2.0"
] | null | null | null | Testing Files/scheduler test.py | Butterparade/School-stuff | 0b92ca29c7c582727226bc18ac590a68d998f822 | [
"Apache-2.0"
] | null | null | null | emp1 = [8, 24]
emp2 = [8, 12]
totalhours = [0, 24]
filledhours = [0, 0]
| 14.4 | 20 | 0.555556 | emp1 = [8, 24]
emp2 = [8, 12]
totalhours = [0, 24]
filledhours = [0, 0]
| true | true |
1c3fa346c1495522249b91e4269ebedcf4b36dfd | 771 | py | Python | colordict/gradients.py | aleferna12/colordict | ee66c3695c755a1a8469f740980c53df0d74471d | [
"MIT"
] | 1 | 2020-05-30T22:01:55.000Z | 2020-05-30T22:01:55.000Z | colordict/gradients.py | aleferna12/colordict | ee66c3695c755a1a8469f740980c53df0d74471d | [
"MIT"
] | 1 | 2021-04-19T19:16:56.000Z | 2021-04-29T12:36:06.000Z | colordict/gradients.py | aleferna12/colordict | ee66c3695c755a1a8469f740980c53df0d74471d | [
"MIT"
] | null | null | null | """Module containing classes to create gradients between colors.
For now only the linear gradient is available.
"""
class LinearGrad(object):
def __init__(self, color_values):
color_values = tuple(color_values)
super().__init__()
self.colors = color_values
def __call__(self, p):
i = int(p * (len(self.colo... | 24.09375 | 69 | 0.647211 |
class LinearGrad(object):
def __init__(self, color_values):
color_values = tuple(color_values)
super().__init__()
self.colors = color_values
def __call__(self, p):
i = int(p * (len(self.colors) - 1))
return self._lin_interp(
self.colors[i],
self.colors[min([i + 1, len(self.colors) - 1])],
p * (l... | true | true |
1c3fa3fc380272b6633e8325e6b5de0740f11444 | 4,539 | py | Python | .history/src/Simulador_20200707141954.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200707141954.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200707141954.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo
import random
class Simulador():
def __init__(
self,
tamanho_matriz, #numero de linhas e colunas da matriz esférica
densidade_populacional_inicial): #percentu... | 40.526786 | 125 | 0.638907 | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo
import random
class Simulador():
def __init__(
self,
tamanho_matriz, densidade_populacional_inicial):
self.num_iteracoes = 0
... | true | true |
1c3fa4b7f383bfaa1a5f9c469da3e85bd03e3a35 | 907 | py | Python | tests/test_apps.py | alairock/integromat | 4fd50531e4934d24a726e91d4885658026ff96a5 | [
"Apache-2.0"
] | null | null | null | tests/test_apps.py | alairock/integromat | 4fd50531e4934d24a726e91d4885658026ff96a5 | [
"Apache-2.0"
] | null | null | null | tests/test_apps.py | alairock/integromat | 4fd50531e4934d24a726e91d4885658026ff96a5 | [
"Apache-2.0"
] | null | null | null | import pytest
from integromat_wrapper.integromat import Apps, AioApps
def test_get_apps(api_key):
# test connection to integromat api
imt_apps = Apps(api_key)
# create a new app
created_app = imt_apps.create_app('test-app-1-hw', 'Test App 1')
newapp_name = created_app.get('name')
newapp_versi... | 25.914286 | 68 | 0.712238 | import pytest
from integromat_wrapper.integromat import Apps, AioApps
def test_get_apps(api_key):
imt_apps = Apps(api_key)
created_app = imt_apps.create_app('test-app-1-hw', 'Test App 1')
newapp_name = created_app.get('name')
newapp_version = created_app.get('version')
assert newapp_versi... | true | true |
1c3fa4fb0b6c6e1f32cb36842725ad128397a212 | 9,624 | py | Python | libs/metrics/social_distancing.py | dok529/smart-social-distancing | fd054c92cf478cefd5326c7beaa288b24dd5110f | [
"Apache-2.0"
] | null | null | null | libs/metrics/social_distancing.py | dok529/smart-social-distancing | fd054c92cf478cefd5326c7beaa288b24dd5110f | [
"Apache-2.0"
] | 1 | 2021-08-25T16:13:56.000Z | 2021-08-25T16:15:19.000Z | libs/metrics/social_distancing.py | myunyui22/smart-social-distancing-dev | 2b71c4330420758a3ff6833923cf2ef81cdebdb1 | [
"Apache-2.0"
] | 1 | 2021-01-13T15:48:56.000Z | 2021-01-13T15:48:56.000Z | import csv
import ast
import numpy as np
import os
from collections import deque
from datetime import datetime, date, timedelta
from typing import Dict, List, Iterator, Tuple
from libs.utils.loggers import get_source_log_directory
from .base import BaseMetric
class SocialDistancingMetric(BaseMetric):
reports_... | 50.387435 | 121 | 0.64256 | import csv
import ast
import numpy as np
import os
from collections import deque
from datetime import datetime, date, timedelta
from typing import Dict, List, Iterator, Tuple
from libs.utils.loggers import get_source_log_directory
from .base import BaseMetric
class SocialDistancingMetric(BaseMetric):
reports_... | true | true |
1c3fa86adc535b5ca59895af3f30fbc046c4133f | 152 | py | Python | adet/modeling/DTMRInst_backup/__init__.py | shuaiqi361/AdelaiDet | 35d944033a8d2f7aa623ad607b57bd8a1fe88b43 | [
"BSD-2-Clause"
] | null | null | null | adet/modeling/DTMRInst_backup/__init__.py | shuaiqi361/AdelaiDet | 35d944033a8d2f7aa623ad607b57bd8a1fe88b43 | [
"BSD-2-Clause"
] | null | null | null | adet/modeling/DTMRInst_backup/__init__.py | shuaiqi361/AdelaiDet | 35d944033a8d2f7aa623ad607b57bd8a1fe88b43 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .DTMRInst import DTMRInst
from .DTMREncode import DistanceTransformEncoding
| 38 | 70 | 0.822368 | from .DTMRInst import DTMRInst
from .DTMREncode import DistanceTransformEncoding
| true | true |
1c3faad72af69451caa228795765f6467ec6e1c0 | 10,382 | py | Python | game/level.py | Magicalbat/Spooktober-Jam-2021 | ba652c0aa3b479f35ea08e26d6f0725bd1706ebd | [
"Unlicense"
] | null | null | null | game/level.py | Magicalbat/Spooktober-Jam-2021 | ba652c0aa3b479f35ea08e26d6f0725bd1706ebd | [
"Unlicense"
] | null | null | null | game/level.py | Magicalbat/Spooktober-Jam-2021 | ba652c0aa3b479f35ea08e26d6f0725bd1706ebd | [
"Unlicense"
] | null | null | null | import pygame
import random
from engine.gamescreen import GameScreen
from engine.tilemap import Tilemap
from engine.text import Text
from engine.menu import Menu
from engine.particles import Particles
from engine.common import *
from game.player import Player
from game.pumpkin import Pumpkin
from game.ghost import G... | 42.203252 | 233 | 0.574648 | import pygame
import random
from engine.gamescreen import GameScreen
from engine.tilemap import Tilemap
from engine.text import Text
from engine.menu import Menu
from engine.particles import Particles
from engine.common import *
from game.player import Player
from game.pumpkin import Pumpkin
from game.ghost import G... | true | true |
1c3fad66793c87698591fd8a85a8f83a19bd9c05 | 14,295 | py | Python | bin/Python27/Lib/site-packages/numpy/lib/arraysetops.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/numpy/lib/arraysetops.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/numpy/lib/arraysetops.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | 1 | 2020-08-08T12:44:48.000Z | 2020-08-08T12:44:48.000Z | """
Set operations for 1D numeric arrays based on sorting.
:Contains:
ediff1d,
unique,
intersect1d,
setxor1d,
in1d,
union1d,
setdiff1d
:Notes:
For floating point arrays, inaccurate results may appear due to usual round-off
and floating point comparison issues.
Speed could be gained in... | 29.719335 | 80 | 0.561525 | from __future__ import division, absolute_import, print_function
import numpy as np
__all__ = [
'ediff1d', 'intersect1d', 'setxor1d', 'union1d', 'setdiff1d', 'unique',
'in1d'
]
def ediff1d(ary, to_end=None, to_begin=None):
ary = np.asanyarray(ary).flat
ed = ary[1:] - ary[:-1]
... | true | true |
1c3fadb18ea5a35b1a6c384aad3f988c75251fce | 1,398 | py | Python | 10_path.py | akfmdl/testdome-python-solutions | f4a2dd2831bc9b11c3374f41c84abc53ff79c01b | [
"MIT"
] | 2 | 2022-02-09T17:30:49.000Z | 2022-02-27T17:25:53.000Z | 10_path.py | akfmdl/testdome-python-solutions | f4a2dd2831bc9b11c3374f41c84abc53ff79c01b | [
"MIT"
] | null | null | null | 10_path.py | akfmdl/testdome-python-solutions | f4a2dd2831bc9b11c3374f41c84abc53ff79c01b | [
"MIT"
] | null | null | null | """
30 min
Write a function that provides change directory (cd) function for an abstract file system.
Notes:
* Root path is '/'.
* Path separator is '/'.
* Parent directory is addressable as '..'.
* Directory names consist only of English alphabet letters (A-Z and a-z).
* The function should support both relative and... | 22.918033 | 90 | 0.55794 |
class Path:
def __init__(self, path):
self.current_path = path
def cd(self, new_path):
if new_path.startswith('/'):
self.current_path = new_path
else:
orig = self.current_path.split('/')
for part in new_path.split('/'):
if part == '.... | true | true |
1c3fafdd497f21f0c7a44fed0e588a194ae3989e | 12,454 | py | Python | pyserializer/serialize.py | deptofdefense/pyserializer | 2f52664ed96b2640f24d4312b2a93db6c75d0b53 | [
"MIT"
] | 1 | 2022-03-05T01:18:08.000Z | 2022-03-05T01:18:08.000Z | pyserializer/serialize.py | deptofdefense/pyserializer | 2f52664ed96b2640f24d4312b2a93db6c75d0b53 | [
"MIT"
] | null | null | null | pyserializer/serialize.py | deptofdefense/pyserializer | 2f52664ed96b2640f24d4312b2a93db6c75d0b53 | [
"MIT"
] | null | null | null | # =================================================================
#
# Work of the U.S. Department of Defense, Defense Digital Service.
# Released as open source under the MIT License. See LICENSE file.
#
# =================================================================
import csv
import json
import pyarrow as pa... | 38.085627 | 119 | 0.453027 |
import csv
import json
import pyarrow as pa
import pandas as pd
from pyserializer.cleaner import clean
from pyserializer.encoder import Encoder
from pyserializer.parquet import DatasetWriter, PartitionWriter
from pyserializer.writer import create_writer
def write_jsonl_tuples(drop_blanks=None, drop_nulls=None, f=N... | true | true |
1c3fb030ac5b90d523c816d4c4a496444658a784 | 1,368 | py | Python | trench/urls/base.py | eriol/django-trench | 27b61479e6d494d7c2e94732c1d186247dac8dd9 | [
"MIT"
] | 190 | 2018-10-26T09:48:26.000Z | 2022-03-31T14:09:28.000Z | trench/urls/base.py | eriol/django-trench | 27b61479e6d494d7c2e94732c1d186247dac8dd9 | [
"MIT"
] | 116 | 2018-10-26T13:04:58.000Z | 2022-03-28T13:51:21.000Z | trench/urls/base.py | eriol/django-trench | 27b61479e6d494d7c2e94732c1d186247dac8dd9 | [
"MIT"
] | 29 | 2018-11-14T07:15:21.000Z | 2022-03-19T08:13:16.000Z | from django.urls import path
__all__ = [
"urlpatterns",
]
from trench.views import (
MFAConfigView,
MFAListActiveUserMethodsView,
MFAMethodActivationView,
MFAMethodBackupCodesRegenerationView,
MFAMethodConfirmActivationView,
MFAMethodDeactivationView,
MFAMethodRequestCodeView,
MFA... | 25.333333 | 87 | 0.645468 | from django.urls import path
__all__ = [
"urlpatterns",
]
from trench.views import (
MFAConfigView,
MFAListActiveUserMethodsView,
MFAMethodActivationView,
MFAMethodBackupCodesRegenerationView,
MFAMethodConfirmActivationView,
MFAMethodDeactivationView,
MFAMethodRequestCodeView,
MFA... | true | true |
1c3fb038214eb4d85d24f39d10adf779811cd5c4 | 891 | py | Python | common/utils/time_series.py | shapeshift-legacy/watchtower | c9cd5150f8549145f7de9b1ea820d548959350fe | [
"MIT"
] | null | null | null | common/utils/time_series.py | shapeshift-legacy/watchtower | c9cd5150f8549145f7de9b1ea820d548959350fe | [
"MIT"
] | null | null | null | common/utils/time_series.py | shapeshift-legacy/watchtower | c9cd5150f8549145f7de9b1ea820d548959350fe | [
"MIT"
] | null | null | null | INTERVALS = {
'weekly': {
'unit': 'weeks',
'amount': 1,
'seconds': 60 * 60 * 24 * 7
},
'daily': {
'unit': 'days',
'amount': 1,
'seconds': 60 * 60 * 24
},
'hourly': {
'unit': 'hours',
'amount': 1,
'seconds': 60 * 60
},
'm... | 18.5625 | 35 | 0.352413 | INTERVALS = {
'weekly': {
'unit': 'weeks',
'amount': 1,
'seconds': 60 * 60 * 24 * 7
},
'daily': {
'unit': 'days',
'amount': 1,
'seconds': 60 * 60 * 24
},
'hourly': {
'unit': 'hours',
'amount': 1,
'seconds': 60 * 60
},
'm... | true | true |
1c3fb16926f14de180ad561de64021de40c453a9 | 936 | py | Python | django_ajax/mixins.py | skhaylov/django-ajax | d513975e536fc4feff5d710bb17d96b2ef80b28c | [
"MIT"
] | null | null | null | django_ajax/mixins.py | skhaylov/django-ajax | d513975e536fc4feff5d710bb17d96b2ef80b28c | [
"MIT"
] | null | null | null | django_ajax/mixins.py | skhaylov/django-ajax | d513975e536fc4feff5d710bb17d96b2ef80b28c | [
"MIT"
] | null | null | null | # coding=utf-8;
__author__ = 'skhaylov'
import json
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from json_response import JSONResponse
class JSONMixin(object):
response_class = JSONResponse
def get_json_context(self):
context = super(J... | 24.631579 | 78 | 0.724359 |
__author__ = 'skhaylov'
import json
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from json_response import JSONResponse
class JSONMixin(object):
response_class = JSONResponse
def get_json_context(self):
context = super(JSONMixin, self).... | true | true |
1c3fb1b1e0e6fa6147508ca62535516c9e779138 | 4,396 | py | Python | test/Fortran/SHF03.py | jcassagnol-public/scons | 8eaf585a893757e68c9e4a6e25d375021fa5eab7 | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/Fortran/SHF03.py | jcassagnol-public/scons | 8eaf585a893757e68c9e4a6e25d375021fa5eab7 | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/Fortran/SHF03.py | jcassagnol-public/scons | 8eaf585a893757e68c9e4a6e25d375021fa5eab7 | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... | 35.168 | 73 | 0.682439 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
_python_ = TestSCons._python_
_obj = TestSCons._shobj
obj_ = TestSCons.shobj_
test = TestSCons.TestSCons()
test.file_fixture(['fixture', 'myfortran.py'])
test.write('SConstruct', """
env = Environment(SHF03 = r'%(_python_)s myfortr... | true | true |
1c3fb3bcdf36a09a0d89dedb18d20ebbe20b866f | 4,466 | py | Python | fuxictr/pytorch/models/HOFM.py | w32zhong/FuxiCTR | f9cac1c5b0a977d6a7dfd16c0ffb524811470f97 | [
"Apache-2.0"
] | null | null | null | fuxictr/pytorch/models/HOFM.py | w32zhong/FuxiCTR | f9cac1c5b0a977d6a7dfd16c0ffb524811470f97 | [
"Apache-2.0"
] | null | null | null | fuxictr/pytorch/models/HOFM.py | w32zhong/FuxiCTR | f9cac1c5b0a977d6a7dfd16c0ffb524811470f97 | [
"Apache-2.0"
] | null | null | null | # =========================================================================
# Copyright (C) 2021. Huawei Technologies Co., Ltd. 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... | 48.021505 | 115 | 0.576131 |
from torch import nn
import torch
from .base_model import BaseModel
from ..layers import LR_Layer, EmbeddingLayer, InnerProductLayer
from itertools import combinations
class HOFM(BaseModel):
def __init__(self,
feature_map,
model_id="HOFM",
gpu=-1,... | true | true |
1c3fb3cedd17e4c492cf2192f069b0c0863eee6d | 2,129 | py | Python | src/robust_deid/ner_datasets/distribution/print_distribution.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | src/robust_deid/ner_datasets/distribution/print_distribution.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | src/robust_deid/ner_datasets/distribution/print_distribution.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | from collections import Counter
from typing import Sequence, NoReturn
from .ner_distribution import NERDistribution
class PrintDistribution(object):
"""
This class is used to print the distribution of NER types
"""
def __init__(self, ner_distribution: NERDistribution, key_counts: Counter) -> NoRetur... | 42.58 | 117 | 0.591827 | from collections import Counter
from typing import Sequence, NoReturn
from .ner_distribution import NERDistribution
class PrintDistribution(object):
def __init__(self, ner_distribution: NERDistribution, key_counts: Counter) -> NoReturn:
self._ner_distribution = ner_distribution
self._key_counts ... | true | true |
1c3fb48f7768e1c691f56a6ad1099f95405463d3 | 569 | py | Python | Dataset/Leetcode/test/8/125.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/8/125.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/8/125.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, str: str) -> int:
sign=1
str=str.strip()
if not str:
return 0
if str[0]=="+" or str[0]=="-":
if str[0]=="-":
sign=-1
str=str[1:]
ans=0
for i in str:
if i.isdigit():
... | 21.074074 | 38 | 0.388401 | class Solution:
def XXX(self, str: str) -> int:
sign=1
str=str.strip()
if not str:
return 0
if str[0]=="+" or str[0]=="-":
if str[0]=="-":
sign=-1
str=str[1:]
ans=0
for i in str:
if i.isdigit():
... | true | true |
1c3fb526e37a26eea6f0226f05b415ad6d775a8e | 72,404 | py | Python | python/ray/serve/tests/test_deployment_state.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | python/ray/serve/tests/test_deployment_state.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | python/ray/serve/tests/test_deployment_state.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
import os
import sys
import time
from typing import Any, Dict, List, Optional, Tuple
from unittest.mock import patch, Mock
import pytest
import ray
from ray.actor import ActorHandle
from ray.serve.common import (
DeploymentConfig,
DeploymentInfo,
DeploymentStatus,
Rep... | 34.36355 | 88 | 0.688788 | from dataclasses import dataclass
import os
import sys
import time
from typing import Any, Dict, List, Optional, Tuple
from unittest.mock import patch, Mock
import pytest
import ray
from ray.actor import ActorHandle
from ray.serve.common import (
DeploymentConfig,
DeploymentInfo,
DeploymentStatus,
Rep... | true | true |
1c3fb6b30b996ff5765cfd6f146b4a0a3f563ca6 | 769 | py | Python | providers/caching/DiskCacheProvider.py | Prouser123/xbl-web-api | eb49032edb34cfbfda7f4cfda7aa1eecc7ea7eb3 | [
"MIT"
] | 16 | 2019-09-30T11:30:56.000Z | 2022-01-28T12:42:53.000Z | providers/caching/DiskCacheProvider.py | Prouser123/xbl-web-api | eb49032edb34cfbfda7f4cfda7aa1eecc7ea7eb3 | [
"MIT"
] | 13 | 2019-05-24T14:34:46.000Z | 2022-02-23T15:35:39.000Z | providers/caching/DiskCacheProvider.py | Prouser123/xbl-web-api | eb49032edb34cfbfda7f4cfda7aa1eecc7ea7eb3 | [
"MIT"
] | 1 | 2021-07-30T23:34:31.000Z | 2021-07-30T23:34:31.000Z | import diskcache
from providers.caching.CacheProvider import CacheProvider
class DiskCacheProvider(CacheProvider):
def __init__(self, path):
self.cache = diskcache.Cache(path)
self.cache.clear() # Clear all items
def get(self, key):
return self.cache.get(key)
def set(self, key,... | 22.617647 | 63 | 0.639792 | import diskcache
from providers.caching.CacheProvider import CacheProvider
class DiskCacheProvider(CacheProvider):
def __init__(self, path):
self.cache = diskcache.Cache(path)
self.cache.clear()
def get(self, key):
return self.cache.get(key)
def set(self, key, value, expire):
... | true | true |
1c3fb705945f1d44f80d75cdcf2b417407d28418 | 5,511 | py | Python | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/update_node_pool_response.py | handsome-baby/huaweicloud-sdk-python-v3 | 6cdcf1da8b098427e58fc3335a387c14df7776d0 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/update_node_pool_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/update_node_pool_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class UpdateNodePoolResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (di... | 25.873239 | 91 | 0.569044 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class UpdateNodePoolResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'api_version': 'str',
'kind': 'str',
'metadata': 'NodePoolMetadata',
'spec': 'NodePoolSpec',
... | true | true |
1c3fb724b82955a9d93f2abdc023952c315d892a | 778 | py | Python | mayan/apps/autoadmin/models.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/autoadmin/models.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/autoadmin/models.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from solo.models import SingletonModel
from .managers import AutoAdminSingletonManager
class AutoAdminSingleton(SingletonModel):
account = models.ForeignKey(
blank=True, null=True, on_de... | 29.923077 | 78 | 0.732648 | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from solo.models import SingletonModel
from .managers import AutoAdminSingletonManager
class AutoAdminSingleton(SingletonModel):
account = models.ForeignKey(
blank=True, null=True, on_de... | true | true |
1c3fb7d69830be9fe5752e67677b4eb12326bb8e | 3,618 | py | Python | calculaIpv4.py | Werberty/Calculando-Redes_IPV4 | c86ef00248c998b74cb6af377989c6f824d37ae4 | [
"MIT"
] | 1 | 2022-03-06T11:37:46.000Z | 2022-03-06T11:37:46.000Z | calculaIpv4.py | Werberty/Calculando-Redes_IPV4 | c86ef00248c998b74cb6af377989c6f824d37ae4 | [
"MIT"
] | null | null | null | calculaIpv4.py | Werberty/Calculando-Redes_IPV4 | c86ef00248c998b74cb6af377989c6f824d37ae4 | [
"MIT"
] | null | null | null | import re
class CalculaIpv4:
def __init__(self, ip, mascara) -> None:
self.ip = ip
self.mascara = mascara
self.prefixo = self.calc_prefixo(mascara)
self.rede = self.calc_ip_rede(ip, mascara)
self.broadcast = self.calc_broadcast(ip, mascara)
self.numero_ips = self.ca... | 30.661017 | 75 | 0.564677 | import re
class CalculaIpv4:
def __init__(self, ip, mascara) -> None:
self.ip = ip
self.mascara = mascara
self.prefixo = self.calc_prefixo(mascara)
self.rede = self.calc_ip_rede(ip, mascara)
self.broadcast = self.calc_broadcast(ip, mascara)
self.numero_ips = self.ca... | true | true |
1c3fb7e4d49e191f28457af06cee9b503f582ccc | 5,190 | py | Python | src/sqlTools/ReaderTools.py | XPH0904/Library-management-system | 9990654070caa9f757af9a6f4771ce4b1b484083 | [
"Apache-2.0"
] | null | null | null | src/sqlTools/ReaderTools.py | XPH0904/Library-management-system | 9990654070caa9f757af9a6f4771ce4b1b484083 | [
"Apache-2.0"
] | null | null | null | src/sqlTools/ReaderTools.py | XPH0904/Library-management-system | 9990654070caa9f757af9a6f4771ce4b1b484083 | [
"Apache-2.0"
] | null | null | null | import traceback
import mysql.connector
from ..model.Reader import Reader
from ..database.database import DatabaseTools
class ReaderTools:
#return for Special ID
def ReaderDataId(self, idReader):
db = DatabaseTools()
conn = db.getConn()
result_set = None
ls = []
try :
... | 27.315789 | 142 | 0.522351 | import traceback
import mysql.connector
from ..model.Reader import Reader
from ..database.database import DatabaseTools
class ReaderTools:
def ReaderDataId(self, idReader):
db = DatabaseTools()
conn = db.getConn()
result_set = None
ls = []
try :
sql = "select... | true | true |
1c3fb92f9cfb2eda4e23250f74cc254577012884 | 533 | py | Python | 4_Tran_Thi_Nhu_Huong_LOCAL/bai4.1.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | null | null | null | 4_Tran_Thi_Nhu_Huong_LOCAL/bai4.1.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | null | null | null | 4_Tran_Thi_Nhu_Huong_LOCAL/bai4.1.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | 8 | 2020-07-10T14:13:54.000Z | 2020-08-03T08:17:50.000Z | """Create Student class with attributes like (Name, Nickname, birthday, class)"""
class Student:
def __init__(self, name, nickname, birthday, class_num):
self.name = name
self.nickname = nickname
self.birthday = birthday
self.class_num = class_num
def show_info(self):
... | 31.352941 | 136 | 0.660413 |
class Student:
def __init__(self, name, nickname, birthday, class_num):
self.name = name
self.nickname = nickname
self.birthday = birthday
self.class_num = class_num
def show_info(self):
print("Name is {}, nickname is {}, birthday is {},class is {}.".format(self.name, ... | true | true |
1c3fb995b1da3003ba9e6ca50446edc20caf3fae | 532 | py | Python | 100 Python Exercises/Day 3/12.py | elipopovadev/Tournament-Tracker | 5b0acbd460257869438e27d3db770ff269ac6d40 | [
"MIT"
] | null | null | null | 100 Python Exercises/Day 3/12.py | elipopovadev/Tournament-Tracker | 5b0acbd460257869438e27d3db770ff269ac6d40 | [
"MIT"
] | 1 | 2022-02-21T12:40:21.000Z | 2022-02-21T12:40:21.000Z | 100 Python Exercises/Day 3/12.py | elipopovadev/Complete-Python-Developer | 5b0acbd460257869438e27d3db770ff269ac6d40 | [
"MIT"
] | null | null | null | import numpy as np
'''Question 12:
Write a program, which will find all such numbers between 1000 and 3000 (both included) such that each digit
of the number is an even number.The numbers obtained should be printed in a comma-separated sequence on a single line.'''
sample_list = []
sample_array = range(1000, 3001)
for... | 38 | 121 | 0.693609 | import numpy as np
sample_list = []
sample_array = range(1000, 3001)
for variable in sample_array:
var = str(variable)
if int(var[0]) % 2 == 0 and int(var[1]) % 2 == 0 and int(var[2]) % 2 and int(var[3]) % 2 == 0:
sample_list.append(var)
print(",".join(sample_list))
| true | true |
1c3fbabd96e05b2650f95dc93074ba84d8a33b06 | 381 | py | Python | tools/gen_interrupts.py | Narasimha1997/r3 | fbeea8de1c7b07bad3a30c511a1085c8dd0c4495 | [
"MIT"
] | 65 | 2022-01-22T11:23:33.000Z | 2022-03-29T12:12:50.000Z | tools/gen_interrupts.py | Narasimha1997/r3 | fbeea8de1c7b07bad3a30c511a1085c8dd0c4495 | [
"MIT"
] | 2 | 2022-01-22T10:49:59.000Z | 2022-01-23T05:50:00.000Z | tools/gen_interrupts.py | Narasimha1997/r3 | fbeea8de1c7b07bad3a30c511a1085c8dd0c4495 | [
"MIT"
] | 3 | 2022-01-22T17:30:19.000Z | 2022-03-12T03:25:37.000Z |
LEGACY_INTERRUPTS_BASE = 0x20
MAX_ARCH_INTERRUPTS = 256
entries = []
writer = open('entries.txt', 'w')
for idx in range(1, MAX_ARCH_INTERRUPTS - LEGACY_INTERRUPTS_BASE):
entry = "IDT.lock().interrupts[LEGACY_HARDWARE_INTERRUPTS_BASE + {}] = prepare_no_irq_handler!(no_irq_fn, {});\n".format(
hex(idx), he... | 29.307692 | 125 | 0.713911 |
LEGACY_INTERRUPTS_BASE = 0x20
MAX_ARCH_INTERRUPTS = 256
entries = []
writer = open('entries.txt', 'w')
for idx in range(1, MAX_ARCH_INTERRUPTS - LEGACY_INTERRUPTS_BASE):
entry = "IDT.lock().interrupts[LEGACY_HARDWARE_INTERRUPTS_BASE + {}] = prepare_no_irq_handler!(no_irq_fn, {});\n".format(
hex(idx), he... | true | true |
1c3fbbb4b422fedd696e2428da5fa8fa8df82664 | 633 | py | Python | Utopian_Tree.py | Quarantinex/Hackerrank_Python_Algorithm | 4a5fc532bfbdac02e66e9d0d9ae279c4e33ca017 | [
"MIT"
] | null | null | null | Utopian_Tree.py | Quarantinex/Hackerrank_Python_Algorithm | 4a5fc532bfbdac02e66e9d0d9ae279c4e33ca017 | [
"MIT"
] | null | null | null | Utopian_Tree.py | Quarantinex/Hackerrank_Python_Algorithm | 4a5fc532bfbdac02e66e9d0d9ae279c4e33ca017 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the utopianTree function below.
def utopianTree(n):
temp = 1
if n == 0:
return temp
else:
for i in range(1,n+1):
if i%2 != 0:
temp = temp*2
elif i%2 =... | 17.583333 | 47 | 0.491311 |
import math
import os
import random
import re
import sys
def utopianTree(n):
temp = 1
if n == 0:
return temp
else:
for i in range(1,n+1):
if i%2 != 0:
temp = temp*2
elif i%2 == 0:
temp = temp+1
... | true | true |
1c3fbc5ca16d62fb96a83ee2f7d3e8ca38a8082a | 3,170 | py | Python | qiskit/result/models.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | 2 | 2021-09-06T19:25:36.000Z | 2021-11-17T10:46:12.000Z | qiskit/result/models.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | qiskit/result/models.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""Schema and helper models for schema-conformant Results."""
from marshmallow.validate import Length, OneOf, Regexp, Range
... | 32.020202 | 90 | 0.66183 |
from marshmallow.validate import Length, OneOf, Regexp, Range
from qiskit.validation.base import BaseModel, BaseSchema, ObjSchema, bind_schema
from qiskit.validation.fields import Complex, ByType
from qiskit.validation.fields import Boolean, DateTime, Integer, List, Nested, Raw, String
from qiskit.validation.valida... | true | true |
1c3fbcaba55e7177584dc605a776aa7a815b290f | 7,249 | py | Python | google/cloud/container_v1/__init__.py | sid-dinesh94/python-container | 8870b0000fc859407f7a8eac391ae06e528b3aae | [
"Apache-2.0"
] | null | null | null | google/cloud/container_v1/__init__.py | sid-dinesh94/python-container | 8870b0000fc859407f7a8eac391ae06e528b3aae | [
"Apache-2.0"
] | null | null | null | google/cloud/container_v1/__init__.py | sid-dinesh94/python-container | 8870b0000fc859407f7a8eac391ae06e528b3aae | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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 o... | 39.82967 | 74 | 0.82301 |
from .services.cluster_manager import ClusterManagerClient
from .types.cluster_service import AcceleratorConfig
from .types.cluster_service import AddonsConfig
from .types.cluster_service import AuthenticatorGroupsConfig
from .types.cluster_service import AutoUpgradeOptions
from .types.cluster_service import Autoprov... | true | true |
1c3fbcd19b3ffbf3c6cb89409faf0751e9908e1d | 5,110 | py | Python | soft/lib.hdf5/customize.py | G4V/ck-env | b882480b00b9dbd88f15eef58440772e09414f64 | [
"BSD-3-Clause"
] | 80 | 2015-03-03T14:27:39.000Z | 2022-01-04T15:37:01.000Z | soft/lib.hdf5/customize.py | G4V/ck-env | b882480b00b9dbd88f15eef58440772e09414f64 | [
"BSD-3-Clause"
] | 78 | 2016-02-20T07:47:05.000Z | 2021-05-01T13:33:31.000Z | soft/lib.hdf5/customize.py | G4V/ck-env | b882480b00b9dbd88f15eef58440772e09414f64 | [
"BSD-3-Clause"
] | 22 | 2016-07-29T07:25:11.000Z | 2021-02-08T16:18:26.000Z | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
##############################################################################
# ... | 25.55 | 97 | 0.501957 |
import os
def limit(i):
dr=i.get('list',[])
drx=[]
for q in dr:
if q.find('.libs')<0 and q.find('anaconda')<0:
drx.append(q)
return {'return':0, 'list':drx}
def version_cmd(i):
ck=i['ck_kernel']
fp=i['full_path']
ver=''
r = ck.access({'action': 'search... | true | true |
1c3fbd449f724a0f3dc9619c6e39da5f11648aac | 6,009 | py | Python | python/oneflow/compatible/single_client/test/ops/test_clip_by_value.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_clip_by_value.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_clip_by_value.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 35.140351 | 88 | 0.644533 |
import unittest
from collections import OrderedDict
import numpy as np
import tensorflow as tf
from test_util import GenArgList
import oneflow.compatible.single_client.unittest
from oneflow.compatible import single_client as flow
from oneflow.compatible.single_client import typing as oft
gpus = tf.config.experiment... | true | true |
1c3fbd972582e7814d0ea0aca085c77b85fb4860 | 5,189 | py | Python | metrics/functional/cls_acc_f1.py | ShannonAI/dice_loss_for_NLP | d437bb999185535df46fdb74d1f2f57161331b44 | [
"Apache-2.0"
] | 143 | 2020-04-25T11:23:10.000Z | 2022-03-30T14:49:21.000Z | metrics/functional/cls_acc_f1.py | ShannonAI/dice_loss_for_NLP | d437bb999185535df46fdb74d1f2f57161331b44 | [
"Apache-2.0"
] | 17 | 2021-04-12T19:11:58.000Z | 2022-02-21T02:42:56.000Z | metrics/functional/cls_acc_f1.py | ShannonAI/dice_loss_for_NLP | d437bb999185535df46fdb74d1f2f57161331b44 | [
"Apache-2.0"
] | 26 | 2021-03-26T08:05:37.000Z | 2022-03-15T07:28:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file: cls_acc_f1.py
# description:
# compute acc and f1 scores for text classification task.
import torch
import torch.nn.functional as F
def collect_confusion_matrix(y_pred_labels, y_gold_labels, num_classes=2):
"""
compute accuracy and f1 scores for text cl... | 39.310606 | 108 | 0.70264 |
import torch
import torch.nn.functional as F
def collect_confusion_matrix(y_pred_labels, y_gold_labels, num_classes=2):
if num_classes <= 0:
raise ValueError
if num_classes == 1 or num_classes == 2:
num_classes = 1
y_true_onehot = y_gold_labels.bool()
y_pred_onehot = y_pred_... | true | true |
1c3fbdcd48e631b7ec93438b03f953b85ecdf799 | 32,297 | py | Python | app/maingame.py | diegoag30/ScrabbleAr | e309b21ec60148b290c45f4edc6bf90d391d144a | [
"MIT"
] | 3 | 2020-05-26T21:02:48.000Z | 2020-08-06T03:19:54.000Z | app/maingame.py | diegoag30/ScrabbleAr | e309b21ec60148b290c45f4edc6bf90d391d144a | [
"MIT"
] | null | null | null | app/maingame.py | diegoag30/ScrabbleAr | e309b21ec60148b290c45f4edc6bf90d391d144a | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
import random
from itertools import combinations
import time
import clasificarPalabra
import IA
import os.path
import config_tablero
from Bolsa import Bolsa
from Configuracion import Configuracion
from puntajes import Puntaje
base_path=os.path.dirname(os.path.abspath(__file__))
""... | 37.467517 | 409 | 0.605319 | import PySimpleGUI as sg
import random
from itertools import combinations
import time
import clasificarPalabra
import IA
import os.path
import config_tablero
from Bolsa import Bolsa
from Configuracion import Configuracion
from puntajes import Puntaje
base_path=os.path.dirname(os.path.abspath(__file__))
de... | true | true |
1c3fbdd86124ddfe35fa159c15df6eb261761d5d | 1,153 | py | Python | exercicios/PythonExercicios/ex059.py | Roberto-Sartore/Python | 98f91f13cf78d761893c4a1f3264ed999244d32b | [
"MIT"
] | null | null | null | exercicios/PythonExercicios/ex059.py | Roberto-Sartore/Python | 98f91f13cf78d761893c4a1f3264ed999244d32b | [
"MIT"
] | null | null | null | exercicios/PythonExercicios/ex059.py | Roberto-Sartore/Python | 98f91f13cf78d761893c4a1f3264ed999244d32b | [
"MIT"
] | null | null | null | from time import sleep
n1 = int(input('Primeiro número:'))
n2 = int(input('Segundo número'))
opcao = 0
while opcao != 5:
print(''' [ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair do programa''')
opcao = int(input('\033[33m Qual é a sua opção? \033[m'))
if opcao ==... | 29.564103 | 87 | 0.529055 | from time import sleep
n1 = int(input('Primeiro número:'))
n2 = int(input('Segundo número'))
opcao = 0
while opcao != 5:
print(''' [ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair do programa''')
opcao = int(input('\033[33m Qual é a sua opção? \033[m'))
if opcao ==... | true | true |
1c3fbf17afd7a87d138502f9050c796fa3c76392 | 7,032 | py | Python | Va-Project/Modules/gomoku_game/Gomoku.py | AdamKatborgpy/Virtuel-assistent | df226c0a0bdeb345840ddc41ea1e91fd77380d6b | [
"MIT"
] | null | null | null | Va-Project/Modules/gomoku_game/Gomoku.py | AdamKatborgpy/Virtuel-assistent | df226c0a0bdeb345840ddc41ea1e91fd77380d6b | [
"MIT"
] | null | null | null | Va-Project/Modules/gomoku_game/Gomoku.py | AdamKatborgpy/Virtuel-assistent | df226c0a0bdeb345840ddc41ea1e91fd77380d6b | [
"MIT"
] | null | null | null | import pygame
from pygame.locals import *
# Define some colors
BLACK = (0, 0, 0)
WHITE = (245, 245, 245)
RED = (133, 42, 44)
YELLOW = (208, 176, 144)
GREEN = (26, 81, 79)
PLAYER = False
# Define grid globals
WIDTH = 20
MARGIN = 1
PADDING = 20
DOT = 4
BOARD = (WIDTH + MARGIN) * 14 + MARGIN
GAME_WIDTH = BOARD + ... | 32.555556 | 115 | 0.486775 | import pygame
from pygame.locals import *
BLACK = (0, 0, 0)
WHITE = (245, 245, 245)
RED = (133, 42, 44)
YELLOW = (208, 176, 144)
GREEN = (26, 81, 79)
PLAYER = False
WIDTH = 20
MARGIN = 1
PADDING = 20
DOT = 4
BOARD = (WIDTH + MARGIN) * 14 + MARGIN
GAME_WIDTH = BOARD + PADDING * 2
GAME_HIGHT = GAME_WIDTH + 100
... | true | true |
1c3fbf6ee31f65152d01042d7740ecb05064ff89 | 1,062 | py | Python | turtlebot3_dqn/nodes/tf_broadcaster.py | 2529342549/turtlebot3_m_learning | 19fc961de8a993eafcd421186ad1c38473d04818 | [
"Apache-2.0"
] | 1 | 2022-02-21T02:02:11.000Z | 2022-02-21T02:02:11.000Z | turtlebot3_dqn/nodes/tf_broadcaster.py | 2529342549/turtlebot3_machine_learning | bdb8cc0fa0110269cd3573d3f78011c3e0201e09 | [
"Apache-2.0"
] | null | null | null | turtlebot3_dqn/nodes/tf_broadcaster.py | 2529342549/turtlebot3_machine_learning | bdb8cc0fa0110269cd3573d3f78011c3e0201e09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
import rospy
from geometry_msgs.msg import Twist, Pose
from nav_msgs.msg import Odometry
import tf
def pose_callback(msg,robotname):
br = tf.TransformBroadcaster() #将坐标变换广播出去
#向/tf发布消息 tb3_0距离原点的坐标x ,y ,平移
br.sendTransform((msg.pose.pose.po... | 37.928571 | 173 | 0.594162 |
import rospy
from geometry_msgs.msg import Twist, Pose
from nav_msgs.msg import Odometry
import tf
def pose_callback(msg,robotname):
br = tf.TransformBroadcaster() br.sendTransform((msg.pose.pose.position.x, msg.pose.pose.position.y, 0),
(msg.pose.pose.orientation.x, msg.pose.... | true | true |
1c3fc02ecf4ffdcde6d9493188d850afab605017 | 792 | py | Python | solutions/Interview-04-er-wei-shu-zu-zhong-de-cha-zhao-lcof/04.py | leetcode-notebook/wonz | 9ffd2ce9b5f3a544ee958f5a0673215afd176c2b | [
"MIT"
] | 12 | 2020-04-21T01:09:14.000Z | 2022-01-13T08:42:03.000Z | solutions/Interview-04-er-wei-shu-zu-zhong-de-cha-zhao-lcof/04.py | leetcode-notebook/wonz | 9ffd2ce9b5f3a544ee958f5a0673215afd176c2b | [
"MIT"
] | null | null | null | solutions/Interview-04-er-wei-shu-zu-zhong-de-cha-zhao-lcof/04.py | leetcode-notebook/wonz | 9ffd2ce9b5f3a544ee958f5a0673215afd176c2b | [
"MIT"
] | 4 | 2020-03-31T03:06:16.000Z | 2021-07-06T07:27:44.000Z | from typing import List
class Solution:
def findNumberIn2DArray(self, matrix: List[List[int]], target: int) -> bool:
# solution one: 暴力
# 特判
if matrix == []:
return False
n, m = len(matrix), len(matrix[0])
for i in range(n):
for j in range(m)... | 27.310345 | 80 | 0.433081 | from typing import List
class Solution:
def findNumberIn2DArray(self, matrix: List[List[int]], target: int) -> bool:
if matrix == []:
return False
n, m = len(matrix), len(matrix[0])
for i in range(n):
for j in range(m):
if mat... | true | true |
1c3fc10050896dd77684b430b69808c0479ca325 | 234 | py | Python | Capstone Two/setup.py | shalin4788/Springboard-Do-not-refer- | e7627e6f4b09456e08c6f10baeb66b0a22422b7a | [
"MIT"
] | 2 | 2020-10-23T06:24:18.000Z | 2020-10-23T06:24:25.000Z | Capstone Two/setup.py | shalin4788/Springboard-Do-not-refer- | e7627e6f4b09456e08c6f10baeb66b0a22422b7a | [
"MIT"
] | 5 | 2021-06-08T22:56:21.000Z | 2022-01-13T03:35:07.000Z | Capstone Two/setup.py | shalin4788/Springboard | e7627e6f4b09456e08c6f10baeb66b0a22422b7a | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Quora insincere data classification',
author='Shalin Gosalia',
license='MIT',
)
| 21.272727 | 55 | 0.653846 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Quora insincere data classification',
author='Shalin Gosalia',
license='MIT',
)
| true | true |
1c3fc2ea92b55d79bb3978373317cc25b7fa52ed | 636 | py | Python | sdeux/utils/alparser.py | ngost/alpes_laser_s2_custom | c2ef808998485e147d32b951bfd8350a4d32be2d | [
"MIT"
] | null | null | null | sdeux/utils/alparser.py | ngost/alpes_laser_s2_custom | c2ef808998485e147d32b951bfd8350a4d32be2d | [
"MIT"
] | null | null | null | sdeux/utils/alparser.py | ngost/alpes_laser_s2_custom | c2ef808998485e147d32b951bfd8350a4d32be2d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on September 01, 2015
Copyright Alpes Lasers SA, Neuchatel, Switzerland, 2015
@author: chiesa
"""
import argparse
import logging
logger = logging.getLogger(__name__)
_version = 'undefined'
try:
from sdeux import pkg, version
_version = '{} {}'.format(pkg, version)
exce... | 20.516129 | 75 | 0.690252 |
import argparse
import logging
logger = logging.getLogger(__name__)
_version = 'undefined'
try:
from sdeux import pkg, version
_version = '{} {}'.format(pkg, version)
except Exception as e:
logger.debug(e, exc_info=1)
baseparser = argparse.ArgumentParser(add_help=False)
baseparser.add_argument("--sho... | true | true |
1c3fc3cbd94a9a36a1c0614624ab4f2519ffad6c | 5,048 | py | Python | tempo/seldon/k8s.py | majolo/tempo | 516b7df0beaf36d69366e8e759ce00a362225278 | [
"Apache-2.0"
] | null | null | null | tempo/seldon/k8s.py | majolo/tempo | 516b7df0beaf36d69366e8e759ce00a362225278 | [
"Apache-2.0"
] | null | null | null | tempo/seldon/k8s.py | majolo/tempo | 516b7df0beaf36d69366e8e759ce00a362225278 | [
"Apache-2.0"
] | null | null | null | import json
import time
from typing import Optional, Sequence
import yaml
from kubernetes import client
from kubernetes.client.rest import ApiException
from tempo.k8s.constants import TempoK8sLabel, TempoK8sModelSpecAnnotation
from tempo.k8s.utils import create_k8s_client
from tempo.seldon.endpoint import Endpoint
fr... | 36.57971 | 93 | 0.612916 | import json
import time
from typing import Optional, Sequence
import yaml
from kubernetes import client
from kubernetes.client.rest import ApiException
from tempo.k8s.constants import TempoK8sLabel, TempoK8sModelSpecAnnotation
from tempo.k8s.utils import create_k8s_client
from tempo.seldon.endpoint import Endpoint
fr... | true | true |
1c3fc41e856187a3e2fe1ff0df604b7b87395070 | 1,702 | py | Python | aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/SetDefaultRegistrantProfileRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/SetDefaultRegistrantProfileRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/SetDefaultRegistrantProfileRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.681818 | 83 | 0.780846 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkdomain.endpoint import endpoint_data
class SetDefaultRegistrantProfileRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Domain', '2018-01-29', 'SetDefaultRegistrantProfile')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
1c3fc5d94d81003b54cea11a1d4e28a8b570d730 | 3,142 | py | Python | src/midi_board/controls/encoder_button.py | lkt23/midi_board | 543fd5d6abf915990a6d3bc2df061066006427f4 | [
"MIT"
] | null | null | null | src/midi_board/controls/encoder_button.py | lkt23/midi_board | 543fd5d6abf915990a6d3bc2df061066006427f4 | [
"MIT"
] | null | null | null | src/midi_board/controls/encoder_button.py | lkt23/midi_board | 543fd5d6abf915990a6d3bc2df061066006427f4 | [
"MIT"
] | null | null | null | """Encoder Controls for a MIDI controller."""
from midi_board.adapters.adapter import Adapter
from midi_board.controls.button import Button
from midi_board.controls.encoder import Encoder
from midi_board import midi_utility
class EncoderButton(Encoder, Button, Adapter):
"""An Encoder with Button control."""
... | 37.404762 | 112 | 0.674093 |
from midi_board.adapters.adapter import Adapter
from midi_board.controls.button import Button
from midi_board.controls.encoder import Encoder
from midi_board import midi_utility
class EncoderButton(Encoder, Button, Adapter):
DEFAULT_NAME = 'encoder'
DEFAULT_DESCRIPTION = 'An encoder with a button.'
def... | true | true |
1c3fc6593cca9bc77e3e6c6e5426fc6faf71bb6d | 9,802 | py | Python | networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus_restapi_events_vxlan.py | Tehsmash/networking-cisco | fdbd79a832fe090f3c4c7bd7a4f0ec0c349d4d16 | [
"Apache-2.0"
] | 1 | 2019-01-19T09:12:49.000Z | 2019-01-19T09:12:49.000Z | networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus_restapi_events_vxlan.py | Tehsmash/networking-cisco | fdbd79a832fe090f3c4c7bd7a4f0ec0c349d4d16 | [
"Apache-2.0"
] | null | null | null | networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus_restapi_events_vxlan.py | Tehsmash/networking-cisco | fdbd79a832fe090f3c4c7bd7a4f0ec0c349d4d16 | [
"Apache-2.0"
] | null | null | null | #Copyright (c) 2017 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.568493 | 77 | 0.55254 |
from oslo_config import cfg
from networking_cisco.plugins.ml2.drivers.cisco.nexus import (
nexus_restapi_snippets as snipp)
from networking_cisco.tests.unit.ml2.drivers.cisco.nexus import (
test_cisco_nexus_base as base)
from networking_cisco.tests.unit.ml2.drivers.cisco.nexus import (
test_cisco_nexus... | true | true |
1c3fca1f69d79f498cd13753a85b2fc3f0428449 | 1,309 | py | Python | app/core/tests/test_admin.py | idy-3/recipe-rest-api | 4ed1db6bda54232c3f0506ece5606fe00fb2eb7b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | idy-3/recipe-rest-api | 4ed1db6bda54232c3f0506ece5606fe00fb2eb7b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | idy-3/recipe-rest-api | 4ed1db6bda54232c3f0506ece5606fe00fb2eb7b | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@idudoh.com',
... | 31.166667 | 68 | 0.638655 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@idudoh.com',
... | true | true |
1c3fcac8dd4a1ba0496ef013bd4eb468a0075125 | 701 | py | Python | benchmark/fluid/models/__init__.py | limeng357/Paddle | dbd25805c88c48998eb9dc0f4b2ca1fd46326482 | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2017-12-04T02:58:01.000Z | 2020-12-03T14:46:30.000Z | benchmark/fluid/models/__init__.py | limeng357/Paddle | dbd25805c88c48998eb9dc0f4b2ca1fd46326482 | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2017-12-05T20:29:08.000Z | 2018-10-15T08:57:40.000Z | benchmark/fluid/models/__init__.py | limeng357/Paddle | dbd25805c88c48998eb9dc0f4b2ca1fd46326482 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2018-03-19T22:38:46.000Z | 2019-11-01T22:28:27.000Z | # Copyright (c) 2018 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... | 38.944444 | 75 | 0.750357 |
__all__ = [
"machine_translation", "resnet", "vgg", "mnist", "stacked_dynamic_lstm"
]
| true | true |
1c3fcae299c5564f70363317bc35a332a100318c | 9,126 | py | Python | hgvs/intervalmapper.py | andreas-invitae/hgvs | 5291f1a4fb1991c6da2d004b0e5ad6bf70bbeb64 | [
"Apache-2.0"
] | 177 | 2017-03-12T12:49:52.000Z | 2022-03-19T10:55:08.000Z | hgvs/intervalmapper.py | andreas-invitae/hgvs | 5291f1a4fb1991c6da2d004b0e5ad6bf70bbeb64 | [
"Apache-2.0"
] | 244 | 2017-03-10T22:53:09.000Z | 2022-02-03T09:25:18.000Z | hgvs/intervalmapper.py | andreas-invitae/hgvs | 5291f1a4fb1991c6da2d004b0e5ad6bf70bbeb64 | [
"Apache-2.0"
] | 77 | 2017-03-12T08:51:34.000Z | 2022-02-09T21:56:12.000Z | # -*- coding: utf-8 -*-
"""
Mapping intervals between pairs of congruent segments
The IntervalMapper class is at the heart of mapping between aligned sequences. An instance
of :class:`uta.tools.intervalmapper.IntervalMapper` is constructed with an ordered list of
:class:`uta.tools.intervalmapper.IntervalPair` instanc... | 39.336207 | 102 | 0.641026 |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import re
from hgvs.exceptions import HGVSInvalidIntervalError
from six.moves import range
_logger = logging.getLogger(__name__)
_logger.warning("This module is deprecated and will be removed in a future release")
cl... | true | true |
1c3fcb5770492394a9cb08febb1f7816ab936f00 | 2,564 | py | Python | src/gausskernel/dbmind/tools/anomaly_detection/detector/algorithm/fb_prophet.py | Yanci0/openGauss-server | b2ff10be1367c77f2fda396d6c12ffa3c25874c7 | [
"MulanPSL-1.0"
] | 360 | 2020-06-30T14:47:34.000Z | 2022-03-31T15:21:53.000Z | src/gausskernel/dbmind/tools/anomaly_detection/detector/algorithm/fb_prophet.py | Yanci0/openGauss-server | b2ff10be1367c77f2fda396d6c12ffa3c25874c7 | [
"MulanPSL-1.0"
] | 4 | 2020-06-30T15:09:16.000Z | 2020-07-14T06:20:03.000Z | src/gausskernel/dbmind/tools/anomaly_detection/detector/algorithm/fb_prophet.py | futurewei-cloud/chogori-opengauss | f43410e1643c887819e718d9baceb9e853ad9574 | [
"MulanPSL-1.0"
] | 133 | 2020-06-30T14:47:36.000Z | 2022-03-25T15:29:00.000Z | """
Copyright (c) 2020 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WI... | 35.123288 | 101 | 0.618175 | import pickle
import time
import pandas as pd
from fbprophet import Prophet
from .model import AlgModel
class FbProphet(AlgModel):
def __init__(self):
AlgModel.__init__(self)
self.model = None
self.train_length = 0
def fit(self, timeseries):
timeseries = pd.DataFrame(timese... | true | true |
1c3fcc29c72899455097c9c023a835636dff2790 | 5,578 | py | Python | Flask/loginRadius-flask-auth/models.py | FuzzySid/engineering-blog-samples | 7521cb1ea6d4300a91142c9e30f09fbcebcf8a1e | [
"MIT"
] | null | null | null | Flask/loginRadius-flask-auth/models.py | FuzzySid/engineering-blog-samples | 7521cb1ea6d4300a91142c9e30f09fbcebcf8a1e | [
"MIT"
] | null | null | null | Flask/loginRadius-flask-auth/models.py | FuzzySid/engineering-blog-samples | 7521cb1ea6d4300a91142c9e30f09fbcebcf8a1e | [
"MIT"
] | null | null | null | """Application Models"""
import bson, os
from dotenv import load_dotenv
from pymongo import MongoClient
from werkzeug.security import generate_password_hash, check_password_hash
load_dotenv()
DATABASE_URL=os.environ.get('DATABASE_URL') or 'mongodb://localhost:27017/myDatabase'
print(DATABASE_URL)
client = MongoClient... | 30.648352 | 95 | 0.551811 | import bson, os
from dotenv import load_dotenv
from pymongo import MongoClient
from werkzeug.security import generate_password_hash, check_password_hash
load_dotenv()
DATABASE_URL=os.environ.get('DATABASE_URL') or 'mongodb://localhost:27017/myDatabase'
print(DATABASE_URL)
client = MongoClient(DATABASE_URL)
db = clien... | true | true |
1c3fd02c8d60b07aa813e5e6f9443d79434be0ec | 29,654 | py | Python | python/neuroglancer/tool/screenshot.py | janelia-cosem/neuroglancer | add6885da32498a1cfd1075a4c19aae8ffb5a6f2 | [
"Apache-2.0"
] | 755 | 2016-06-06T13:56:32.000Z | 2022-03-31T14:48:19.000Z | python/neuroglancer/tool/screenshot.py | janelia-cosem/neuroglancer | add6885da32498a1cfd1075a4c19aae8ffb5a6f2 | [
"Apache-2.0"
] | 331 | 2016-06-07T22:06:43.000Z | 2022-03-24T21:48:51.000Z | python/neuroglancer/tool/screenshot.py | janelia-cosem/neuroglancer | add6885da32498a1cfd1075a4c19aae8ffb5a6f2 | [
"Apache-2.0"
] | 240 | 2016-06-07T00:56:43.000Z | 2022-03-31T21:10:50.000Z | #!/usr/bin/env python
# @license
# Copyright 2020 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 applicab... | 41.707454 | 399 | 0.634956 |
import argparse
import collections
import contextlib
import copy
import datetime
import itertools
import numbers
import os
import threading
import time
from typing import NamedTuple, Tuple, Callable, Iterator, List, Optional
import PIL
import numpy as np
import neuroglancer
import neuroglancer.cli
import neuroglance... | true | true |
1c3fd089676e66f279943ebbb8aa269ae5ba3497 | 1,343 | py | Python | demo/dcgan_v3_generate.py | hircumg/keras-text-to-image | 365cf61075b04e9a98f69d471f0efd8b7e0adb6f | [
"MIT"
] | null | null | null | demo/dcgan_v3_generate.py | hircumg/keras-text-to-image | 365cf61075b04e9a98f69d471f0efd8b7e0adb6f | [
"MIT"
] | null | null | null | demo/dcgan_v3_generate.py | hircumg/keras-text-to-image | 365cf61075b04e9a98f69d471f0efd8b7e0adb6f | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
from random import shuffle
def main():
seed = 42
np.random.seed(seed)
current_dir = os.path.dirname(__file__)
sys.path.append(os.path.join(current_dir, '..'))
current_dir = current_dir if current_dir is not '' else '.'
img_dir_path = current_dir + '/da... | 29.844444 | 128 | 0.699181 | import os
import sys
import numpy as np
from random import shuffle
def main():
seed = 42
np.random.seed(seed)
current_dir = os.path.dirname(__file__)
sys.path.append(os.path.join(current_dir, '..'))
current_dir = current_dir if current_dir is not '' else '.'
img_dir_path = current_dir + '/da... | true | true |
1c3fd17fd284852ba7aeedaa87ca07e74fdd23e5 | 32,578 | py | Python | python/paddle/fluid/tests/unittests/test_optimizer.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | 1 | 2020-11-03T04:57:40.000Z | 2020-11-03T04:57:40.000Z | python/paddle/fluid/tests/unittests/test_optimizer.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_optimizer.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | 4 | 2019-09-30T02:15:34.000Z | 2019-09-30T02:41:30.000Z | # Copyright (c) 2018 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 app... | 42.474576 | 80 | 0.610228 |
from __future__ import print_function
import unittest
import paddle.fluid.framework as framework
import paddle.fluid.optimizer as optimizer
import paddle.compat as cpt
from paddle.fluid.backward import append_backward
class TestOptimizer(unittest.TestCase):
def test_sgd_optimizer(self):
def check_sgd_o... | true | true |
1c3fd18d95dde9b8c931da1988561fbe274ebc18 | 14,247 | py | Python | tests/function/test_simple.py | klmitch/micropath | 3de7f3d3da59dea802b502ebc71ec5e139e25e1f | [
"Apache-2.0"
] | 1 | 2018-06-07T22:17:14.000Z | 2018-06-07T22:17:14.000Z | tests/function/test_simple.py | klmitch/micropath | 3de7f3d3da59dea802b502ebc71ec5e139e25e1f | [
"Apache-2.0"
] | null | null | null | tests/function/test_simple.py | klmitch/micropath | 3de7f3d3da59dea802b502ebc71ec5e139e25e1f | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 by Kevin L. Mitchell <klmitch@mit.edu>
#
# 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 applicabl... | 30.184322 | 77 | 0.610865 |
import micropath
from tests.function import utils
class BookController(micropath.Controller):
@micropath.route('get')
def index(self, request, sub_id=None):
return 'book::index(sub_id=%s)' % utils.safestr(sub_id)
@micropath.route('post')
def create(self, request, sub_id=None):
retur... | true | true |
1c3fd1a1d43154bc61a1a422c1177bc1c1c2e413 | 424 | py | Python | library_member/__manifest__.py | jhonaelramos/Odoo-14-Development-Essentials | 52d1317c67b629233f5e246105d452018ae01700 | [
"MIT"
] | 8 | 2020-06-29T15:23:01.000Z | 2021-11-08T13:10:50.000Z | library_member/__manifest__.py | jhonaelramos/Odoo-14-Development-Essentials | 52d1317c67b629233f5e246105d452018ae01700 | [
"MIT"
] | null | null | null | library_member/__manifest__.py | jhonaelramos/Odoo-14-Development-Essentials | 52d1317c67b629233f5e246105d452018ae01700 | [
"MIT"
] | 11 | 2020-08-31T13:39:00.000Z | 2021-11-06T13:05:07.000Z | {
"name": "Library Members",
"description": "Manage members borrowing books.",
"author": "Daniel Reis",
"depends": ["library_app", "mail"],
"application": False,
"data": [
"security/library_security.xml",
"security/ir.model.access.csv",
"views/book_view.xml",
"vie... | 26.5 | 53 | 0.582547 | {
"name": "Library Members",
"description": "Manage members borrowing books.",
"author": "Daniel Reis",
"depends": ["library_app", "mail"],
"application": False,
"data": [
"security/library_security.xml",
"security/ir.model.access.csv",
"views/book_view.xml",
"vie... | true | true |
1c3fd2c55334fd038f3412b030377b167a93d36d | 1,037 | py | Python | Django/DjangoT3.2_LTS/06 Pagination dan queryset pada ListView/blog/views.py | Akhadafi/WEB-Framework | 4547a682ac1f007aa6f97512baf76b92ef1c9b9a | [
"MIT"
] | null | null | null | Django/DjangoT3.2_LTS/06 Pagination dan queryset pada ListView/blog/views.py | Akhadafi/WEB-Framework | 4547a682ac1f007aa6f97512baf76b92ef1c9b9a | [
"MIT"
] | null | null | null | Django/DjangoT3.2_LTS/06 Pagination dan queryset pada ListView/blog/views.py | Akhadafi/WEB-Framework | 4547a682ac1f007aa6f97512baf76b92ef1c9b9a | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic import ListView
from .models import Artikel
# Create your views here.
class ArtikelListView(ListView):
model = Artikel
# urut berdasarkan
ordering = ["judul"]
# membagi halaman
paginate_by = 2
extra_context = {
"judul": "Bl... | 24.690476 | 56 | 0.577628 | from django.shortcuts import render
from django.views.generic import ListView
from .models import Artikel
class ArtikelListView(ListView):
model = Artikel
ordering = ["judul"]
paginate_by = 2
extra_context = {
"judul": "Blog List",
}
def get_queryset(self):
if self.kw... | true | true |
1c3fd34730bf6106bb035873310bd6717278ea53 | 3,724 | py | Python | server/migrations/versions/5e634fc119ae_.py | TheKnarf/proost-app | 7b7b9a20d6a9ca51424421e62765c7c26e4c4b78 | [
"Apache-2.0"
] | 6 | 2019-11-20T17:25:09.000Z | 2019-12-06T11:07:21.000Z | server/migrations/versions/5e634fc119ae_.py | TheKnarf/proost-app | 7b7b9a20d6a9ca51424421e62765c7c26e4c4b78 | [
"Apache-2.0"
] | 6 | 2019-12-10T18:26:51.000Z | 2021-10-06T07:40:51.000Z | server/migrations/versions/5e634fc119ae_.py | itso-io/aika | 86f333edcd3ad2d3125cbbd6c9f37764c8e05848 | [
"Unlicense"
] | 1 | 2019-12-06T11:08:57.000Z | 2019-12-06T11:08:57.000Z | """empty message
Revision ID: 5e634fc119ae
Revises: 3368ac633bb4
Create Date: 2019-10-09 21:52:05.255230
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '5e634fc119ae'
down_revision = '3368ac633bb4'
branch_labels = None
depe... | 40.478261 | 138 | 0.707304 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = '5e634fc119ae'
down_revision = '3368ac633bb4'
branch_labels = None
depends_on = None
def upgrade(engine_name):
globals()["upgrade_%s" % engine_name]()
def downgrade(engine_name):
globals()["downgrade_%s" % engin... | true | true |
1c3fd38688bd2384d0ceb47363edfc9a526b2e63 | 2,883 | py | Python | classy/migrations/0018_auto_20180306_1051.py | Krocodial/DSC | 91063b06b536e732e655ce7f1ad0b7c2caa61e0d | [
"Apache-2.0"
] | null | null | null | classy/migrations/0018_auto_20180306_1051.py | Krocodial/DSC | 91063b06b536e732e655ce7f1ad0b7c2caa61e0d | [
"Apache-2.0"
] | null | null | null | classy/migrations/0018_auto_20180306_1051.py | Krocodial/DSC | 91063b06b536e732e655ce7f1ad0b7c2caa61e0d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.1 on 2018-03-06 18:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classy', '0017_classification_review_classy_id'),
]
operations = [
migrations.AlterField(
model_name='classification',
... | 33.917647 | 133 | 0.57232 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classy', '0017_classification_review_classy_id'),
]
operations = [
migrations.AlterField(
model_name='classification',
name='column_name',
field=models.... | true | true |
1c3fd3b3cd4e5e6f759361f63f2b7ee6e61e7c88 | 13,290 | py | Python | simpletransformers/experimental/classification/classification_utils.py | kinoute/simpletransformers | c14d01c8011cbdbf51996f07fc2fbe3d3c433f46 | [
"Apache-2.0"
] | 4 | 2020-03-06T00:03:22.000Z | 2021-01-21T14:07:25.000Z | simpletransformers/experimental/classification/classification_utils.py | kinoute/simpletransformers | c14d01c8011cbdbf51996f07fc2fbe3d3c433f46 | [
"Apache-2.0"
] | 4 | 2019-12-24T10:55:32.000Z | 2020-03-27T02:19:07.000Z | simpletransformers/experimental/classification/classification_utils.py | kinoute/simpletransformers | c14d01c8011cbdbf51996f07fc2fbe3d3c433f46 | [
"Apache-2.0"
] | 1 | 2021-01-21T14:36:55.000Z | 2021-01-21T14:36:55.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 40.03012 | 229 | 0.666441 |
from __future__ import absolute_import, division, print_function
import os
import sys
import csv
import logging
from io import open
from multiprocessing import Pool, cpu_count
from tqdm.auto import tqdm
from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import matthews_corrcoef, f1_score
logger = lo... | true | true |
1c3fd450d13f394c1939457f17417a0da2f33a35 | 12,127 | py | Python | z.mine/test/ExpTestTrainedModel.py | hunsooni/sumo-rl | 92fb5716c22bf71e6fcf976c5e65c9e47f44a2fc | [
"MIT"
] | null | null | null | z.mine/test/ExpTestTrainedModel.py | hunsooni/sumo-rl | 92fb5716c22bf71e6fcf976c5e65c9e47f44a2fc | [
"MIT"
] | null | null | null | z.mine/test/ExpTestTrainedModel.py | hunsooni/sumo-rl | 92fb5716c22bf71e6fcf976c5e65c9e47f44a2fc | [
"MIT"
] | null | null | null |
# from https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_model.py
import argparse
import os
import ray
from ray import tune
from ray.rllib.agents.dqn.distributional_q_tf_model import DistributionalQTFModel
from ray.rllib.models import ModelCatalog
from ray.rllib.models.tf.misc import normc_in... | 35.049133 | 125 | 0.681372 |
import argparse
import os
import ray
from ray import tune
from ray.rllib.agents.dqn.distributional_q_tf_model import DistributionalQTFModel
from ray.rllib.models import ModelCatalog
from ray.rllib.models.tf.misc import normc_initializer
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.policy.policy... | true | true |
1c3fd582b6c3eb660989a7e8560f197c75a80c2b | 396 | py | Python | app/article/migrations/0018_auto_20200601_1120.py | nabechin/article | 63bbaaaa9c194cc259456c46d8c3ccd0f8ee10c1 | [
"MIT"
] | null | null | null | app/article/migrations/0018_auto_20200601_1120.py | nabechin/article | 63bbaaaa9c194cc259456c46d8c3ccd0f8ee10c1 | [
"MIT"
] | 9 | 2020-07-09T15:29:48.000Z | 2020-07-29T13:05:30.000Z | app/article/migrations/0018_auto_20200601_1120.py | nabechin/article | 63bbaaaa9c194cc259456c46d8c3ccd0f8ee10c1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2020-06-01 11:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0017_comment_user'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='content',
... | 20.842105 | 63 | 0.60101 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0017_comment_user'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='content',
field=models.TextField(blank=True, max_len... | true | true |
1c3fd5d5fc441b45465cee3727a99a6456d08b0b | 5,309 | py | Python | horovod/runner/common/util/hosts.py | zarzen/horovod | d3c93d7b97c6158f003dad9aa377fe2bbf194e38 | [
"Apache-2.0"
] | 7,676 | 2019-02-12T02:57:22.000Z | 2022-03-31T21:05:40.000Z | horovod/runner/common/util/hosts.py | zarzen/horovod | d3c93d7b97c6158f003dad9aa377fe2bbf194e38 | [
"Apache-2.0"
] | 2,431 | 2019-02-12T01:34:21.000Z | 2022-03-31T21:43:38.000Z | horovod/runner/common/util/hosts.py | zarzen/horovod | d3c93d7b97c6158f003dad9aa377fe2bbf194e38 | [
"Apache-2.0"
] | 1,557 | 2019-02-12T07:52:15.000Z | 2022-03-31T21:05:43.000Z | # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.032051 | 97 | 0.618761 |
import collections
import re
from dataclasses import dataclass
class HostInfo:
def __init__(self, hostname, slots):
self.hostname = hostname
self.slots = slots
@staticmethod
def from_string(host_string):
hostname, slots = host_string.strip().split(':')
return HostInfo(ho... | true | true |
1c3fd60d60e1b548ab64d419546139d32861b974 | 1,150 | py | Python | libs/ExtractLocation.py | douglask3/UKESM_albedo_tile_optimization | 6f9d39c6fae7d671bf5e455a871ea48cda512aab | [
"BSD-3-Clause"
] | 1 | 2019-10-09T11:57:31.000Z | 2019-10-09T11:57:31.000Z | libs/ExtractLocation.py | douglask3/UKESM-ConFire | 344b07b9f5c230dd3925a05b96a54d127e3dd39c | [
"BSD-3-Clause"
] | null | null | null | libs/ExtractLocation.py | douglask3/UKESM-ConFire | 344b07b9f5c230dd3925a05b96a54d127e3dd39c | [
"BSD-3-Clause"
] | null | null | null | import iris
from pdb import set_trace as browser
class ExtractLocation(object):
def __init__(self, cubes, west= None, east = None, south = None, north = None):
self.lon = self.coordRange2List([west, east])
self.lat = self.coordRange2List([south, north])
def lonRange(cel... | 38.333333 | 95 | 0.564348 | import iris
from pdb import set_trace as browser
class ExtractLocation(object):
def __init__(self, cubes, west= None, east = None, south = None, north = None):
self.lon = self.coordRange2List([west, east])
self.lat = self.coordRange2List([south, north])
def lonRange(cel... | true | true |
1c3fd64e6099747c37dee97de029d91872fabe84 | 155 | py | Python | produtos/apps.py | SolutionUp/SolutionUP-System | 4f341df1a51a43b350e626d47abd207a55edb94d | [
"MIT"
] | 4 | 2021-08-30T01:45:46.000Z | 2022-01-08T18:05:10.000Z | produtos/apps.py | DiskFar/DiskFar-System | dfd687e55cbca03118656d14761eb5de6c5a58a9 | [
"MIT"
] | 6 | 2021-08-29T03:26:48.000Z | 2021-09-24T00:13:11.000Z | produtos/apps.py | DiskFar/DiskFar-System | dfd687e55cbca03118656d14761eb5de6c5a58a9 | [
"MIT"
] | 1 | 2021-08-16T21:21:34.000Z | 2021-08-16T21:21:34.000Z | from django.apps import AppConfig
class EstoqueProdutosConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'produtos'
| 22.142857 | 56 | 0.774194 | from django.apps import AppConfig
class EstoqueProdutosConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'produtos'
| true | true |
1c3fd67199919cae4449110ec7ddd4039586f363 | 5,139 | py | Python | stock_alerter/tests/test_rule.py | aamco-software/product-dev | 02931667ff1a8a97a0f2debdff1618820eb0e0b5 | [
"MIT"
] | 1 | 2020-11-08T22:26:01.000Z | 2020-11-08T22:26:01.000Z | stock_alerter/tests/test_rule.py | aamco-software/product-dev | 02931667ff1a8a97a0f2debdff1618820eb0e0b5 | [
"MIT"
] | null | null | null | stock_alerter/tests/test_rule.py | aamco-software/product-dev | 02931667ff1a8a97a0f2debdff1618820eb0e0b5 | [
"MIT"
] | 4 | 2016-05-26T13:30:59.000Z | 2021-01-18T19:33:55.000Z | import unittest
from datetime import datetime
from ..stock import Stock
from ..rule import PriceRule, TrendRule, AndRule
class PriceRuleTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
... | 42.122951 | 82 | 0.657132 | import unittest
from datetime import datetime
from ..stock import Stock
from ..rule import PriceRule, TrendRule, AndRule
class PriceRuleTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
... | true | true |
1c3fd7009ea90c16a51ea4de59f4f5a27f39e9bd | 1,719 | py | Python | pol/curd/user.py | MoguCloud/server | f33e5cb3556a4fc99592c28b7ea4893708d9dbbd | [
"BSD-3-Clause"
] | null | null | null | pol/curd/user.py | MoguCloud/server | f33e5cb3556a4fc99592c28b7ea4893708d9dbbd | [
"BSD-3-Clause"
] | null | null | null | pol/curd/user.py | MoguCloud/server | f33e5cb3556a4fc99592c28b7ea4893708d9dbbd | [
"BSD-3-Clause"
] | null | null | null | from typing import Optional
from datetime import datetime, timedelta
from loguru import logger
from pydantic import BaseModel
from sqlalchemy.ext.asyncio import AsyncSession
from pol import sa
from pol.db.tables import ChiiMember, ChiiOauthAccessToken
from pol.permission import Role, UserGroup
from pol.curd.exception... | 26.446154 | 75 | 0.680628 | from typing import Optional
from datetime import datetime, timedelta
from loguru import logger
from pydantic import BaseModel
from sqlalchemy.ext.asyncio import AsyncSession
from pol import sa
from pol.db.tables import ChiiMember, ChiiOauthAccessToken
from pol.permission import Role, UserGroup
from pol.curd.exception... | true | true |
1c3fd7a17e7dc122fce64c4ea4fa0d975dd40cc5 | 1,874 | py | Python | tests/contract_tests/KT1NYqJMeLbUKuNaRrXyePrCZ4Uth2HU3173/test_nyqjme_addToken.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | 98 | 2019-02-07T16:33:38.000Z | 2022-03-31T15:53:41.000Z | tests/contract_tests/KT1NYqJMeLbUKuNaRrXyePrCZ4Uth2HU3173/test_nyqjme_addToken.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | 152 | 2019-05-20T16:38:56.000Z | 2022-03-30T14:24:38.000Z | tests/contract_tests/KT1NYqJMeLbUKuNaRrXyePrCZ4Uth2HU3173/test_nyqjme_addToken.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | 34 | 2019-07-25T12:03:51.000Z | 2021-11-11T22:23:38.000Z | from unittest import TestCase
from os.path import dirname, join
import json
from pytezos.michelson.program import MichelsonProgram
from pytezos.michelson.types.big_map import big_map_diff_to_lazy_diff
from pytezos.michelson.forge import forge_micheline, unforge_micheline
folder = 'dexter_usdtz_xtz'
entrypoint = 'remo... | 39.041667 | 112 | 0.721985 | from unittest import TestCase
from os.path import dirname, join
import json
from pytezos.michelson.program import MichelsonProgram
from pytezos.michelson.types.big_map import big_map_diff_to_lazy_diff
from pytezos.michelson.forge import forge_micheline, unforge_micheline
folder = 'dexter_usdtz_xtz'
entrypoint = 'remo... | true | true |
1c3fd85d598b3d6c44fb247eae813bcf20a7a88e | 742 | py | Python | docs/code_snippets/map_reduce/limitations/single_mapping_node/invalid.py | raztud/dagger | 7b394138c139e3b4fdf228e3d34359f1ae6bdd7a | [
"Apache-2.0"
] | 9 | 2021-09-06T14:22:38.000Z | 2022-02-08T07:48:39.000Z | docs/code_snippets/map_reduce/limitations/single_mapping_node/invalid.py | raztud/dagger | 7b394138c139e3b4fdf228e3d34359f1ae6bdd7a | [
"Apache-2.0"
] | 36 | 2021-09-04T06:20:19.000Z | 2021-12-26T17:54:59.000Z | docs/code_snippets/map_reduce/limitations/single_mapping_node/invalid.py | raztud/dagger | 7b394138c139e3b4fdf228e3d34359f1ae6bdd7a | [
"Apache-2.0"
] | 4 | 2021-09-06T08:07:19.000Z | 2021-10-18T19:13:18.000Z | from typing import List
from dagger import dsl
Partition = str
@dsl.task()
def get_partitions() -> List[Partition]:
return ["first", "second", "...", "last"]
@dsl.task()
def do_something_with(partition: Partition) -> Partition:
return f"{partition}*"
@dsl.task()
def do_something_else_with(partition: Par... | 19.526316 | 62 | 0.684636 | from typing import List
from dagger import dsl
Partition = str
@dsl.task()
def get_partitions() -> List[Partition]:
return ["first", "second", "...", "last"]
@dsl.task()
def do_something_with(partition: Partition) -> Partition:
return f"{partition}*"
@dsl.task()
def do_something_else_with(partition: Par... | true | true |
1c3fd85dad49a2866b00e6e6336ab5dd4353b86e | 13,938 | py | Python | src/sage/rings/padics/padic_base_generic.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | 1 | 2021-03-15T21:45:56.000Z | 2021-03-15T21:45:56.000Z | src/sage/rings/padics/padic_base_generic.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | null | null | null | src/sage/rings/padics/padic_base_generic.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | null | null | null | r"""
`p`-Adic Base Generic
A superclass for implementations of `\ZZ_p` and `\QQ_p`.
AUTHORS:
- David Roe
"""
#*****************************************************************************
# Copyright (C) 2007-2013 David Roe <roed.math@gmail.com>
# William Stein <wstein@gmail.com>... | 30.565789 | 175 | 0.536088 |
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from .padic_generic import pAdicGeneric
from .misc import precprint
from sage.rings.padics.pow_computer import PowComputer
from sage.rings.padics.padic_capped_relative_element import pAdicCoercion_ZZ_CR, pAdicCoercion_QQ_CR, pAdicConvert... | true | true |
1c3fd8926309431eb4f88378356064832fc6f8c6 | 149 | py | Python | febio_python/test/test_feb.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | febio_python/test/test_feb.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | febio_python/test/test_feb.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | import unittest
from febio_python import feb
class test_feb(unittest.TestCase):
def test_load_feb(self):
feb.FEBio_feb("./sample.feb")
| 18.625 | 37 | 0.731544 | import unittest
from febio_python import feb
class test_feb(unittest.TestCase):
def test_load_feb(self):
feb.FEBio_feb("./sample.feb")
| true | true |
1c3fd9c8cb6f1720691d88a108b04aa9c9562f9a | 2,706 | py | Python | testjinja/testjinja/settings.py | csiubru/py | 769d7f5f4278e1c3b3719203e372992859268347 | [
"MIT"
] | null | null | null | testjinja/testjinja/settings.py | csiubru/py | 769d7f5f4278e1c3b3719203e372992859268347 | [
"MIT"
] | null | null | null | testjinja/testjinja/settings.py | csiubru/py | 769d7f5f4278e1c3b3719203e372992859268347 | [
"MIT"
] | null | null | null | """
Django settings for testjinja project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | 25.528302 | 71 | 0.695492 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'l1h47cgs#9s4%2ki1e=+%sc1-hw$p2wf-w+l$#1hhytms&7#@0'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
1c3fdad50a1ce722cf607472598169e7f53cbe31 | 4,140 | py | Python | setup.py | cwoebker/paxo | 7d0dbc8e7ef5a1cb7f9fb14d765ada0134fd4a12 | [
"BSD-3-Clause"
] | 1 | 2018-09-16T13:04:53.000Z | 2018-09-16T13:04:53.000Z | setup.py | cwoebker/paxo | 7d0dbc8e7ef5a1cb7f9fb14d765ada0134fd4a12 | [
"BSD-3-Clause"
] | null | null | null | setup.py | cwoebker/paxo | 7d0dbc8e7ef5a1cb7f9fb14d765ada0134fd4a12 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
# Note: also necessary for building the code:
# $ pip install wheel
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
... | 28.551724 | 86 | 0.638164 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
import paxo
NAME = paxo.__title__
DESCRIPTION = 'paxo: python ♡ terminal'
URL = 'https://github.com/cwoebker/paxo'
EMAIL = 'me@cwoebker.com'
AUTHOR = paxo.__author__
REQUIRES_PYTHON = '>=3.6.0'
VERSION = p... | true | true |
1c3fdb16e203e45980d65e859f19336bbd347cea | 3,983 | py | Python | trainweak.py | HKUST-KnowComp/MLMET | ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | [
"MIT"
] | 10 | 2021-05-21T16:16:05.000Z | 2022-02-23T11:22:52.000Z | trainweak.py | HKUST-KnowComp/MLMET | ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | [
"MIT"
] | 4 | 2021-07-03T05:20:01.000Z | 2021-08-08T16:48:44.000Z | trainweak.py | HKUST-KnowComp/MLMET | ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | [
"MIT"
] | 3 | 2021-08-20T08:26:45.000Z | 2022-03-13T14:10:16.000Z | import datetime
import torch
import os
import logging
from utils import utils
from exp import bertufexp
import config
def __setup_logging(to_file):
log_file = os.path.join(config.DATA_DIR, 'ultrafine/log/{}-{}-{}-{}.log'.format(os.path.splitext(
os.path.basename(__file__))[0], args.idx, str_today, config.... | 47.416667 | 112 | 0.72709 | import datetime
import torch
import os
import logging
from utils import utils
from exp import bertufexp
import config
def __setup_logging(to_file):
log_file = os.path.join(config.DATA_DIR, 'ultrafine/log/{}-{}-{}-{}.log'.format(os.path.splitext(
os.path.basename(__file__))[0], args.idx, str_today, config.... | true | true |
1c3fdb75e6069de112bca35146a844c47b3af97c | 8,504 | py | Python | ADBShell.py | AlvISsReimu/ArknightsAutoHelper | 7112b73c01fe381b20314342ba0dfa2f7e01805d | [
"MIT"
] | 2 | 2021-07-14T04:03:57.000Z | 2022-03-17T03:23:19.000Z | ADBShell.py | AlvISsReimu/ArknightsAutoHelper | 7112b73c01fe381b20314342ba0dfa2f7e01805d | [
"MIT"
] | null | null | null | ADBShell.py | AlvISsReimu/ArknightsAutoHelper | 7112b73c01fe381b20314342ba0dfa2f7e01805d | [
"MIT"
] | null | null | null | import os
from config import ADB_ROOT, ADB_HOST, SCREEN_SHOOT_SAVE_PATH, ShellColor
from PIL import Image
from time import sleep
from random import randint
# from numpy import average, dot, linalg
class ADBShell(object):
def __init__(self, adb_host=ADB_HOST):
self.SCREEN_SHOOT_SAVE_PATH = os.path.abspath(... | 39.37037 | 108 | 0.549271 | import os
from config import ADB_ROOT, ADB_HOST, SCREEN_SHOOT_SAVE_PATH, ShellColor
from PIL import Image
from time import sleep
from random import randint
class ADBShell(object):
def __init__(self, adb_host=ADB_HOST):
self.SCREEN_SHOOT_SAVE_PATH = os.path.abspath(SCREEN_SHOOT_SAVE_PATH) + "\\"
... | true | true |
1c3fdb9f9201128eeca24377e0cb7fd4a8ed0437 | 9,923 | py | Python | libs/PureCloudPlatformClientV2/models/voicemail_group_policy.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 1 | 2021-10-08T20:46:45.000Z | 2021-10-08T20:46:45.000Z | libs/PureCloudPlatformClientV2/models/voicemail_group_policy.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | null | null | null | libs/PureCloudPlatformClientV2/models/voicemail_group_policy.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 31.302839 | 116 | 0.623299 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class VoicemailGroupPolicy(object):
def __init__(self):
self.swagger_types = {
'name': 'str',
'group': 'Group',
'enabled': 'bool',
'se... | true | true |
1c3fdc8113753c7644cdee8192c0a0284c64bf30 | 68,259 | py | Python | se/se_epub_lint.py | jggimi/tools | b4aa35f986b22ab1b92dae1e0bfad9c4d94b6cf7 | [
"CC0-1.0"
] | null | null | null | se/se_epub_lint.py | jggimi/tools | b4aa35f986b22ab1b92dae1e0bfad9c4d94b6cf7 | [
"CC0-1.0"
] | null | null | null | se/se_epub_lint.py | jggimi/tools | b4aa35f986b22ab1b92dae1e0bfad9c4d94b6cf7 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
"""
Contains the LintMessage class and the Lint function, which is broken out of
the SeEpub class for readability and maintainability.
Strictly speaking, the lint() function should be a class member of SeEpub. But
the function is very big and it makes editing easier to put in a separate file.
""... | 57.312343 | 1,259 | 0.692934 |
import filecmp
import glob
import html
import io
import os
import unicodedata
from pathlib import Path
from typing import Dict, List
import importlib_resources
import lxml.cssselect
import lxml.etree as etree
import regex
import roman
from bs4 import BeautifulSoup, NavigableString
import se
import se.easy_xml
import s... | true | true |
1c3fdd4f966d9a2d8fcf67855782831abc65b4ad | 337 | py | Python | modules/first_module.py | BigMountainTiger/p-virtualenv-excercise | 8f1f32de59f9b4b2be2ed9d212842385d3d48f1b | [
"MIT"
] | null | null | null | modules/first_module.py | BigMountainTiger/p-virtualenv-excercise | 8f1f32de59f9b4b2be2ed9d212842385d3d48f1b | [
"MIT"
] | null | null | null | modules/first_module.py | BigMountainTiger/p-virtualenv-excercise | 8f1f32de59f9b4b2be2ed9d212842385d3d48f1b | [
"MIT"
] | null | null | null | class _FirstClass:
def __init__(self, name, age):
self.name = name
self.age = age
firstObject = _FirstClass('Song', 20)
class ANumber:
def __init__(self, n):
self.number = n
a_number = ANumber(50)
def set_a_number(n):
a_number.number = n
def get_a_number():
return a_number
print('first_module... | 16.047619 | 37 | 0.682493 | class _FirstClass:
def __init__(self, name, age):
self.name = name
self.age = age
firstObject = _FirstClass('Song', 20)
class ANumber:
def __init__(self, n):
self.number = n
a_number = ANumber(50)
def set_a_number(n):
a_number.number = n
def get_a_number():
return a_number
print('first_module... | true | true |
1c3fdd509254afc2cb7712d828b5d4ce54dab04e | 430 | py | Python | npbench/benchmarks/nbody/nbody.py | frahlg/npbench | 1bc4d9e2e22f3ca67fa2bc7f40e2e751a9c8dd26 | [
"BSD-3-Clause"
] | 27 | 2021-05-10T11:49:13.000Z | 2022-03-22T18:07:19.000Z | npbench/benchmarks/nbody/nbody.py | frahlg/npbench | 1bc4d9e2e22f3ca67fa2bc7f40e2e751a9c8dd26 | [
"BSD-3-Clause"
] | 3 | 2021-12-01T13:03:17.000Z | 2022-03-17T10:53:00.000Z | npbench/benchmarks/nbody/nbody.py | frahlg/npbench | 1bc4d9e2e22f3ca67fa2bc7f40e2e751a9c8dd26 | [
"BSD-3-Clause"
] | 7 | 2021-06-24T03:40:25.000Z | 2022-01-26T09:04:33.000Z | # Copyright 2021 ETH Zurich and the NPBench authors. All rights reserved.
import numpy as np
def initialize(N, tEnd, dt):
from numpy.random import default_rng
rng = default_rng(42)
mass = 20.0 * np.ones((N, 1)) / N # total mass of particles is 20
pos = rng.random((N, 3)) # randomly selected positio... | 30.714286 | 74 | 0.65814 |
import numpy as np
def initialize(N, tEnd, dt):
from numpy.random import default_rng
rng = default_rng(42)
mass = 20.0 * np.ones((N, 1)) / N pos = rng.random((N, 3)) vel = rng.random((N, 3))
Nt = int(np.ceil(tEnd / dt))
return mass, pos, vel, Nt
| true | true |
1c3fdd608b5db1307869afe943ad188d63c4110b | 197 | py | Python | tests/mytest.py | UmboCV/logutils | 3f9d37f1dc649f3a01c7a1593b3a40f77aafa89f | [
"BSD-3-Clause"
] | null | null | null | tests/mytest.py | UmboCV/logutils | 3f9d37f1dc649f3a01c7a1593b3a40f77aafa89f | [
"BSD-3-Clause"
] | null | null | null | tests/mytest.py | UmboCV/logutils | 3f9d37f1dc649f3a01c7a1593b3a40f77aafa89f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from logutils.testing import TestHandler, Matcher
class MyTestHandler(TestHandler):
def __init__(self):
TestHandler.__init__(self, Matcher())
| 19.7 | 49 | 0.771574 | from __future__ import absolute_import
from logutils.testing import TestHandler, Matcher
class MyTestHandler(TestHandler):
def __init__(self):
TestHandler.__init__(self, Matcher())
| true | true |
1c3fdd659991042710d33ea957b1e3751d39955f | 742 | py | Python | instagram/urls.py | enock24/Instagram-clone | 6f213b1f42ddd2d0c7b6694b09ace990182c6245 | [
"MIT"
] | null | null | null | instagram/urls.py | enock24/Instagram-clone | 6f213b1f42ddd2d0c7b6694b09ace990182c6245 | [
"MIT"
] | 3 | 2020-03-08T20:18:54.000Z | 2022-03-12T00:23:17.000Z | instagram/urls.py | enock24/Instagram-clone | 6f213b1f42ddd2d0c7b6694b09ace990182c6245 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$', views.index, name='index'),
url(r'^profile/$', views.profile,name='profile'),
url(r'^edit/$', views.edit_profile,name='edit_profile'),
url(r'^user/$... | 30.916667 | 81 | 0.67655 | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$', views.index, name='index'),
url(r'^profile/$', views.profile,name='profile'),
url(r'^edit/$', views.edit_profile,name='edit_profile'),
url(r'^user/$... | true | true |
1c3fdd83082337c34febe14b2fa59434882d5ad3 | 38,457 | py | Python | python/taichi/lang/kernel_impl.py | Lyken17/taichi | 888a1792bd8566c31afc960c64b3c5fe838d444d | [
"MIT"
] | null | null | null | python/taichi/lang/kernel_impl.py | Lyken17/taichi | 888a1792bd8566c31afc960c64b3c5fe838d444d | [
"MIT"
] | null | null | null | python/taichi/lang/kernel_impl.py | Lyken17/taichi | 888a1792bd8566c31afc960c64b3c5fe838d444d | [
"MIT"
] | null | null | null | import ast
import functools
import inspect
import re
import sys
import textwrap
import traceback
import numpy as np
import taichi.lang
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, util
from taichi.lang.ast.checkers import KernelSimplicityASTChecker
from taichi.lang.ast.transformer imp... | 39.28192 | 307 | 0.584575 | import ast
import functools
import inspect
import re
import sys
import textwrap
import traceback
import numpy as np
import taichi.lang
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, util
from taichi.lang.ast.checkers import KernelSimplicityASTChecker
from taichi.lang.ast.transformer imp... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.