hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d59e60abaebaaaecba5bc9c804151d46cefabbd | 3,346 | py | Python | crawler.py | dboth/AssociatedArtistCrawler | 8497aa49476fe184508344929642cd5435358da4 | [
"Apache-2.0"
] | null | null | null | crawler.py | dboth/AssociatedArtistCrawler | 8497aa49476fe184508344929642cd5435358da4 | [
"Apache-2.0"
] | null | null | null | crawler.py | dboth/AssociatedArtistCrawler | 8497aa49476fe184508344929642cd5435358da4 | [
"Apache-2.0"
] | null | null | null | # -- coding: utf-8 --
import json, urllib2, re
class ArtistCrawler:
def __init__(self, outputfile, stackfile, donefile):
#at least one artist has to be in the stackfile!
self.outputb = open(outputfile,"a")
self.stackfile = stackfile
self.donefile = donefile
with open(stackfi... | 32.173077 | 165 | 0.505678 |
92795ebb1aa4190d0614cdffe90ea3bee2daa361 | 5,587 | py | Python | third_party/maya/lib/usdMaya/testenv/testUsdMayaModelKindWriter.py | navefx/YuksUSD | 56c2e1def36ee07121f4ecb349c1626472b3c338 | [
"AML"
] | 18 | 2017-10-28T22:37:48.000Z | 2022-01-26T12:00:24.000Z | third_party/maya/lib/usdMaya/testenv/testUsdMayaModelKindWriter.py | navefx/YuksUSD | 56c2e1def36ee07121f4ecb349c1626472b3c338 | [
"AML"
] | 1 | 2021-08-14T23:57:51.000Z | 2021-08-14T23:57:51.000Z | third_party/maya/lib/usdMaya/testenv/testUsdMayaModelKindWriter.py | navefx/YuksUSD | 56c2e1def36ee07121f4ecb349c1626472b3c338 | [
"AML"
] | 4 | 2018-06-14T18:14:59.000Z | 2021-09-13T22:20:50.000Z | #!/pxrpythonsubst
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 36.756579 | 83 | 0.64847 |
4c6a64050589d3e77a284b4e4b84dd745e721b7c | 2,331 | py | Python | src/python/nimbusml/examples/RobustScaler.py | montehoover/NimbusML | f6be39ce9359786976429bab0ccd837e849b4ba5 | [
"MIT"
] | 134 | 2018-11-01T22:15:24.000Z | 2019-05-04T11:30:08.000Z | src/python/nimbusml/examples/RobustScaler.py | montehoover/NimbusML | f6be39ce9359786976429bab0ccd837e849b4ba5 | [
"MIT"
] | 226 | 2019-05-07T19:00:44.000Z | 2021-01-06T07:59:48.000Z | src/python/nimbusml/examples/RobustScaler.py | montehoover/NimbusML | f6be39ce9359786976429bab0ccd837e849b4ba5 | [
"MIT"
] | 43 | 2019-05-15T20:19:42.000Z | 2022-03-30T10:26:07.000Z | ###############################################################################
# RobustScaler
import numpy
from nimbusml import FileDataStream
from nimbusml.datasets import get_dataset
from nimbusml.preprocessing.normalization import RobustScaler
# data input (as a FileDataStream)
path = get_dataset('infert').as_file... | 58.275 | 108 | 0.374088 |
416ce5e03292d1f4e65b04bd36f628378cb4f9d7 | 7,598 | py | Python | processText.py | norbertbin/subredditAnalysis | 1951267f8e1cd993a9a3aa294a9b7e8caee71545 | [
"MIT"
] | null | null | null | processText.py | norbertbin/subredditAnalysis | 1951267f8e1cd993a9a3aa294a9b7e8caee71545 | [
"MIT"
] | null | null | null | processText.py | norbertbin/subredditAnalysis | 1951267f8e1cd993a9a3aa294a9b7e8caee71545 | [
"MIT"
] | null | null | null | import sklearn
import sqlite3 as lite
import string
from nltk.corpus import stopwords
from scipy import io
from collections import Counter
from itertools import dropwhile
from nltk.tokenize import word_tokenize
from submission import Submission
from comment import Comment
### define constants
DB_NAME = "data/raw_subr... | 35.504673 | 103 | 0.685049 |
e1d1a2490e6e2724eb4701b98ef22c09730207a5 | 3,313 | py | Python | examples/positioned.py | lostinplace/parsita | 2aa4fefc3df88baa75655ce5c631b27ac55d1ad4 | [
"MIT"
] | 68 | 2016-09-25T20:21:08.000Z | 2022-01-31T23:53:42.000Z | examples/positioned.py | lostinplace/parsita | 2aa4fefc3df88baa75655ce5c631b27ac55d1ad4 | [
"MIT"
] | 26 | 2016-09-29T19:58:19.000Z | 2022-01-02T00:38:55.000Z | examples/positioned.py | lostinplace/parsita | 2aa4fefc3df88baa75655ce5c631b27ac55d1ad4 | [
"MIT"
] | 9 | 2016-09-29T19:47:23.000Z | 2022-01-01T21:32:34.000Z | """User-defined positioned parser example.
This shows how a new parser can be defined outside Parsita and used in tandem
with the built-in parsers. The ``positioned`` parser updates the value
returned from an arbitrary parser with the position in the input that was
consumed by that parser.
"""
from abc import abstrac... | 31.254717 | 106 | 0.695442 |
c036cb1421a174b91196a901ee7e59d3d954bb7b | 14,407 | py | Python | models/cite/FastText/test.py | DeepWTO/deepwto-draft | c61dc02e4ce3e72e8423c712ddc5483f851443f5 | [
"Apache-2.0"
] | 34 | 2019-02-04T14:57:08.000Z | 2022-02-07T13:32:35.000Z | models/cite/FastText/test.py | syyunn/DeepWTO | 0e9f206ec2ce24b1afdf895bc81509dd84235b82 | [
"Apache-2.0"
] | 3 | 2020-03-02T05:06:24.000Z | 2020-03-06T08:39:18.000Z | models/cite/FastText/test.py | DeepWTO/deepwto-draft | c61dc02e4ce3e72e8423c712ddc5483f851443f5 | [
"Apache-2.0"
] | 4 | 2020-02-17T04:17:12.000Z | 2022-02-07T14:27:01.000Z | # This code is referenced from https://github.com/RandolphVIm and modified by
# Zachary
# -*- coding:utf-8 -*-
# This code is referenced from https://github.com/RandolphVIm and modified by
# Zachary
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
__modify__ = 'Zachary'
import os
import sys
import time
import numpy as n... | 42.125731 | 79 | 0.534046 |
f25d45277f581f1bc31d12bbaa29538771c03fd5 | 2,193 | py | Python | hdlConvertorAst/translate/common/discover_declarations.py | mewais/hdlConvertorAst | 64c8c1deee923ffae17e70e0fb1ad763cb69608c | [
"MIT"
] | null | null | null | hdlConvertorAst/translate/common/discover_declarations.py | mewais/hdlConvertorAst | 64c8c1deee923ffae17e70e0fb1ad763cb69608c | [
"MIT"
] | null | null | null | hdlConvertorAst/translate/common/discover_declarations.py | mewais/hdlConvertorAst | 64c8c1deee923ffae17e70e0fb1ad763cb69608c | [
"MIT"
] | null | null | null | from itertools import chain
from hdlConvertorAst.hdlAst import iHdlStatement, HdlIdDef,\
HdlModuleDec, HdlModuleDef, HdlCompInst
from hdlConvertorAst.to.hdl_ast_visitor import HdlAstVisitor
from hdlConvertorAst.translate.common.name_scope import WithNameScope
class DiscoverDeclarations(HdlAstVisitor):
def _... | 29.635135 | 79 | 0.615595 |
2ab80078522b8a897c6503952400aeec5f95a3f9 | 3,896 | py | Python | lib/opentypesvg/utils.py | davidgodzsak/opentype-svg | 038bb25bcf9ccf0408bde708c4758674d7db5247 | [
"MIT"
] | 166 | 2016-09-14T07:42:58.000Z | 2022-03-27T14:37:27.000Z | lib/opentypesvg/utils.py | davidgodzsak/opentype-svg | 038bb25bcf9ccf0408bde708c4758674d7db5247 | [
"MIT"
] | 13 | 2017-08-03T18:02:32.000Z | 2021-06-01T07:08:41.000Z | lib/opentypesvg/utils.py | davidgodzsak/opentype-svg | 038bb25bcf9ccf0408bde708c4758674d7db5247 | [
"MIT"
] | 17 | 2018-01-20T03:21:40.000Z | 2022-02-26T12:33:17.000Z | # Copyright 2016 Adobe. All rights reserved.
"""
Module that contains shared functionality.
"""
import os
import sys
SVG_FOLDER_NAME = "SVGs"
NESTED_FOLDER_NAME = "_moreSVGs_"
def read_file(file_path):
with open(file_path, "r") as f:
return f.read()
def write_file(file_path, data):
with open(fil... | 29.969231 | 79 | 0.670945 |
a90271ad98d0d445ff9e367954e5dda5192e62ed | 3,101 | py | Python | gaphor/diagram/tests/fixtures.py | seryafarma/gaphor | f85998ae3a3ec5381b25cda60d89a47383c4fd2e | [
"Apache-2.0"
] | null | null | null | gaphor/diagram/tests/fixtures.py | seryafarma/gaphor | f85998ae3a3ec5381b25cda60d89a47383c4fd2e | [
"Apache-2.0"
] | null | null | null | gaphor/diagram/tests/fixtures.py | seryafarma/gaphor | f85998ae3a3ec5381b25cda60d89a47383c4fd2e | [
"Apache-2.0"
] | null | null | null | from io import StringIO
import pytest
from gaphas.aspect import ConnectionSink
from gaphas.aspect import Connector as ConnectorAspect
from gaphor.core.eventmanager import EventManager
from gaphor.core.modeling import Diagram, ElementFactory
from gaphor.core.modeling.elementdispatcher import ElementDispatcher
from gap... | 23.853846 | 85 | 0.695905 |
9ed324f46941ec3fe00901d914c4ab662eeedc97 | 22 | py | Python | nnsubspace/nnsubspace/__init__.py | jiweiqi/nnsubspace | e443a949982ca950a0ab85bcf01dcfe2a65d3ee3 | [
"MIT"
] | 5 | 2019-06-07T16:42:42.000Z | 2021-08-31T14:56:10.000Z | nnsubspace/nnsubspace/__init__.py | jiweiqi/nnsubspace | e443a949982ca950a0ab85bcf01dcfe2a65d3ee3 | [
"MIT"
] | null | null | null | nnsubspace/nnsubspace/__init__.py | jiweiqi/nnsubspace | e443a949982ca950a0ab85bcf01dcfe2a65d3ee3 | [
"MIT"
] | 5 | 2019-04-28T02:47:47.000Z | 2021-12-03T17:53:13.000Z | __all__ = ['subspace'] | 22 | 22 | 0.681818 |
5bfc724d5dc5d5e2c827b7f06d0fb1d6238a4933 | 2,477 | py | Python | dungeons/views.py | zachtib/MagicWithFriends | 18db849fe282903051820b718a2d7b434360e332 | [
"MIT"
] | null | null | null | dungeons/views.py | zachtib/MagicWithFriends | 18db849fe282903051820b718a2d7b434360e332 | [
"MIT"
] | 5 | 2021-02-15T20:52:10.000Z | 2021-07-03T18:19:59.000Z | dungeons/views.py | zachtib/MagicWithFriends | 18db849fe282903051820b718a2d7b434360e332 | [
"MIT"
] | null | null | null | from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from dungeons.models import Dungeon, DungeonRoom
COMPLETED_DUNGEONS = "completed_dungeons"
def dungeon_list(request):
completed_dungeon_... | 35.898551 | 112 | 0.702059 |
f9c3e3104f76dd8ffa99ecd072445665859d125d | 10,454 | py | Python | src/resources/host_api.py | jwagantall/cello | 8fa6980148a96f925c40d78014cfc9c856bb3091 | [
"Apache-2.0"
] | null | null | null | src/resources/host_api.py | jwagantall/cello | 8fa6980148a96f925c40d78014cfc9c856bb3091 | [
"Apache-2.0"
] | null | null | null | src/resources/host_api.py | jwagantall/cello | 8fa6980148a96f925c40d78014cfc9c856bb3091 | [
"Apache-2.0"
] | null | null | null |
# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
import logging
import os
import sys
import uuid
from flask import jsonify, Blueprint, render_template
from flask import request as r
import json
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from common import... | 37.469534 | 78 | 0.55749 |
fd2336fe23ff2c8a3143fcb946142daa072745a8 | 1,164 | py | Python | pycoreutils/main.py | davidfischer/pycoreutils | a5f72d4765b2340eb2ac96099e8de87214a908fa | [
"MIT"
] | 25 | 2016-11-03T06:41:01.000Z | 2022-03-20T20:42:47.000Z | pycoreutils/main.py | davidfischer/pycoreutils | a5f72d4765b2340eb2ac96099e8de87214a908fa | [
"MIT"
] | 1 | 2021-04-05T16:11:24.000Z | 2021-04-11T15:41:21.000Z | pycoreutils/main.py | davidfischer/pycoreutils | a5f72d4765b2340eb2ac96099e8de87214a908fa | [
"MIT"
] | 3 | 2016-12-31T14:37:03.000Z | 2018-10-03T22:38:23.000Z | import importlib
from .commands import commands
from .vendor import click
from .version import __version__
class PycoreutilsMulticommand(click.MultiCommand):
def list_commands(self, ctx):
return commands
def get_command(self, ctx, name):
try:
mod = importlib.import_module(u'pycor... | 28.390244 | 86 | 0.571306 |
c9d282e7404076a31997d71173e502bd5b385669 | 605 | py | Python | test/widget/test_dialog_config.py | HansBug/pyqt5-demo | df10ba54209bcf993d5dab8d969ab63d7a0acc90 | [
"Apache-2.0"
] | null | null | null | test/widget/test_dialog_config.py | HansBug/pyqt5-demo | df10ba54209bcf993d5dab8d969ab63d7a0acc90 | [
"Apache-2.0"
] | null | null | null | test/widget/test_dialog_config.py | HansBug/pyqt5-demo | df10ba54209bcf993d5dab8d969ab63d7a0acc90 | [
"Apache-2.0"
] | null | null | null | import pytest
from app.config.meta import __TITLE__, __VERSION__, __AUTHOR__, __AUTHOR_EMAIL__
from app.widget import DialogConfig
@pytest.mark.unittest
class TestDialogConfig:
def test_common(self, qtbot):
dc = DialogConfig(None)
qtbot.addWidget(dc)
title_info_str = dc.label_title.text... | 28.809524 | 80 | 0.723967 |
6f94350453d25f6165ba422c00a407c26c5dbd93 | 29,657 | py | Python | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/aio/operations/_partner_registrations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/aio/operations/_partner_registrations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/aio/operations/_partner_registrations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.066451 | 251 | 0.680109 |
b59650536365c6bdc0111ab9761c3dff6ebeba96 | 11,098 | py | Python | pandasdmx/writer.py | daoluan/pandaSDMX | 2efcb5a429a5306efd89bed4cd55946d1ad5067b | [
"Apache-2.0"
] | null | null | null | pandasdmx/writer.py | daoluan/pandaSDMX | 2efcb5a429a5306efd89bed4cd55946d1ad5067b | [
"Apache-2.0"
] | null | null | null | pandasdmx/writer.py | daoluan/pandaSDMX | 2efcb5a429a5306efd89bed4cd55946d1ad5067b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from pandasdmx.model import (
DEFAULT_LOCALE,
AgencyScheme,
DataflowDefinition,
DataStructureDefinition,
DataSet,
Dimension,
# DimensionDescriptor,
CategoryScheme,
Codelist,
Component,
ConceptScheme,
ItemScheme,
NameableArtefact... | 32.168116 | 79 | 0.634889 |
f60da6c1898bf557edb2aa52348faa7a25de0374 | 13,807 | py | Python | guides/customizing_what_happens_in_fit.py | pavithrasv/keras-io | ffbfaf9b263690a47fffb5f5438d44ca2f554979 | [
"Apache-2.0"
] | 1 | 2020-08-28T08:31:52.000Z | 2020-08-28T08:31:52.000Z | guides/customizing_what_happens_in_fit.py | pavithrasv/keras-io | ffbfaf9b263690a47fffb5f5438d44ca2f554979 | [
"Apache-2.0"
] | null | null | null | guides/customizing_what_happens_in_fit.py | pavithrasv/keras-io | ffbfaf9b263690a47fffb5f5438d44ca2f554979 | [
"Apache-2.0"
] | null | null | null | """
Title: Customizing what happens in `fit()`
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2020/04/15
Last modified: 2020/04/15
Description: Complete guide to overriding the training step of the Model class.
"""
"""
## Introduction
When you're doing supervised learning, you can use `fit()` and ever... | 34.60401 | 88 | 0.686681 |
6fb79f0ff0188fc596457da4c563f634b80c906e | 5,421 | py | Python | test_proj/settings.py | artscoop/django-admin-tools | f98189615db5114ef3b136c90983a6bc5590c9af | [
"MIT"
] | 6 | 2016-02-18T10:00:34.000Z | 2021-05-27T09:41:35.000Z | venv/lib/python2.7/site-packages/test_proj/settings.py | WhySoGeeky/DroidPot | 7c3d9e975dae3835e2ccf42c425d65b26466e82a | [
"MIT"
] | 6 | 2018-03-30T10:06:12.000Z | 2021-06-10T17:59:44.000Z | test_proj/settings.py | artscoop/django-admin-tools | f98189615db5114ef3b136c90983a6bc5590c9af | [
"MIT"
] | null | null | null | # settings for django-admin-tools test project.
import os
import sys
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.dirname(PROJECT_PATH))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'defa... | 34.528662 | 108 | 0.723298 |
2e84ab6fd65dd656a8b3e5ebf0cffba9ed639087 | 13,138 | py | Python | tools/wptrunner/wptrunner/executors/executorselenium.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | null | null | null | tools/wptrunner/wptrunner/executors/executorselenium.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | null | null | null | tools/wptrunner/wptrunner/executors/executorselenium.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | null | null | null | import json
import os
import socket
import sys
import threading
import time
import traceback
import urlparse
import uuid
from .base import (Protocol,
RefTestExecutor,
RefTestImplementation,
TestharnessExecutor,
extra_timeout,
... | 36.393352 | 100 | 0.576572 |
0186d72a792f0ce6439d0b9f96ac1e1fbbb65ef4 | 8,680 | py | Python | configs/htc/htc_x101_64x4d_fpn_20e_16gpu.py | jiangwenj02/SOLO | f0a1de652028236d7935274f51c509008903ad7b | [
"BSD-2-Clause"
] | 1,467 | 2020-03-24T01:38:24.000Z | 2022-03-31T03:02:05.000Z | configs/htc/htc_x101_64x4d_fpn_20e_16gpu.py | cds-mipt/cds-mmdetection | da6b1c82715c189bf33e944c6edda80590b5a867 | [
"Apache-2.0"
] | 208 | 2020-03-26T16:24:23.000Z | 2022-03-30T13:12:07.000Z | configs/htc/htc_x101_64x4d_fpn_20e_16gpu.py | cds-mipt/cds-mmdetection | da6b1c82715c189bf33e944c6edda80590b5a867 | [
"Apache-2.0"
] | 300 | 2020-03-24T03:55:02.000Z | 2022-03-29T19:08:07.000Z | # model settings
model = dict(
type='HybridTaskCascade',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
interleaved=True,
mask_info_flow=True,
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(... | 31.33574 | 79 | 0.554147 |
8f1207ecfdadeabfdb8931aa196b0d7fac9abaea | 3,122 | py | Python | text_classification/network_conf.py | nickyfantasy/paddlepaddle_models | cb5e1f600bf6d69f25d7c9a40743452bdd0e1670 | [
"Apache-2.0"
] | null | null | null | text_classification/network_conf.py | nickyfantasy/paddlepaddle_models | cb5e1f600bf6d69f25d7c9a40743452bdd0e1670 | [
"Apache-2.0"
] | null | null | null | text_classification/network_conf.py | nickyfantasy/paddlepaddle_models | cb5e1f600bf6d69f25d7c9a40743452bdd0e1670 | [
"Apache-2.0"
] | 1 | 2019-01-22T15:40:57.000Z | 2019-01-22T15:40:57.000Z | import sys
import math
import gzip
from paddle.v2.layer import parse_network
import paddle.v2 as paddle
__all__ = ["fc_net", "convolution_net"]
def fc_net(dict_dim,
class_num,
emb_dim=28,
hidden_layer_sizes=[28, 8],
is_infer=False):
"""
define the topology of the ... | 30.31068 | 80 | 0.639974 |
1d773f607e8e327b6f761b3bb1f28990264f4e98 | 26,528 | py | Python | sympy/utilities/tests/test_lambdify.py | tachycline/sympy | abf6fec12012852c7e6fae38461da9723cadc8b9 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/tests/test_lambdify.py | tachycline/sympy | abf6fec12012852c7e6fae38461da9723cadc8b9 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/tests/test_lambdify.py | tachycline/sympy | abf6fec12012852c7e6fae38461da9723cadc8b9 | [
"BSD-3-Clause"
] | null | null | null | from itertools import product
import math
import mpmath
from sympy.utilities.pytest import XFAIL, raises
from sympy import (
symbols, lambdify, sqrt, sin, cos, tan, pi, acos, acosh, Rational,
Float, Matrix, Lambda, Piecewise, exp, Integral, oo, I, Abs, Function,
true, false, And, Or, Not, ITE, Min, Max, fl... | 32.750617 | 89 | 0.594353 |
66eb2bc60d57fc150b5c7f04d5eee41fc1554cc6 | 206 | py | Python | tutorial/Austrian_energy_system/tools.py | ardasha93/message_ix | f68403d1c3b62392a082d008198f87e706e6ffc2 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | tutorial/Austrian_energy_system/tools.py | ardasha93/message_ix | f68403d1c3b62392a082d008198f87e706e6ffc2 | [
"Apache-2.0",
"CC-BY-4.0"
] | 2 | 2018-08-09T13:26:01.000Z | 2020-03-13T09:04:45.000Z | tutorial/Austrian_energy_system/tools.py | behnam2015/message_ix | 430a6d967be6cf473a8bbf1576a1e478bd399a92 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | import sys
import os
here = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
path = os.path.join(here, '..', 'utils')
sys.path.append(path)
from plotting import *
from run_scenarios import *
| 18.727273 | 67 | 0.728155 |
0551956667bfe569c10718bdb97a124f5c40ab14 | 51,039 | py | Python | src/python/grpcio/grpc_core_dependencies.py | casperisfine/grpc | 9facfe2b684bbaaf9e75e2d285e7bffceeefe2b1 | [
"Apache-2.0"
] | 1 | 2019-07-24T18:08:51.000Z | 2019-07-24T18:08:51.000Z | src/python/grpcio/grpc_core_dependencies.py | casperisfine/grpc | 9facfe2b684bbaaf9e75e2d285e7bffceeefe2b1 | [
"Apache-2.0"
] | 9 | 2019-07-22T21:13:22.000Z | 2019-12-11T08:50:56.000Z | src/python/grpcio/grpc_core_dependencies.py | casperisfine/grpc | 9facfe2b684bbaaf9e75e2d285e7bffceeefe2b1 | [
"Apache-2.0"
] | 1 | 2019-12-17T06:56:33.000Z | 2019-12-17T06:56:33.000Z | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 59.004624 | 118 | 0.752444 |
4f8b6c2d2a741d4acb4af4d2a0d6ab31c6ce18b3 | 679 | py | Python | chapter04/dags/listing_4_5.py | add54/Data_PipeLine_Apache_Airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 303 | 2019-09-30T10:59:15.000Z | 2022-03-30T17:03:27.000Z | chapter04/dags/listing_4_5.py | andreaschandra/data-pipelines-with-apache-airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 13 | 2020-04-08T12:28:30.000Z | 2021-12-30T06:40:37.000Z | chapter04/dags/listing_4_5.py | andreaschandra/data-pipelines-with-apache-airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 148 | 2020-01-03T03:30:39.000Z | 2022-03-28T04:19:43.000Z | from urllib import request
import airflow.utils.dates
from airflow import DAG
from airflow.operators.python import PythonOperator
dag = DAG(
dag_id="listing_4_05",
start_date=airflow.utils.dates.days_ago(1),
schedule_interval="@hourly",
)
def _get_data(execution_date):
year, month, day, hour, *_ = e... | 27.16 | 91 | 0.708395 |
dab02c2cbb55b4a2a8cc2c8452bf3af69e78761c | 400 | py | Python | python-projects/uppercase_and_reverse.py | iamvalentin23/onemonth | a44a4eb131824d9224170b55264902e63354da6e | [
"MIT"
] | null | null | null | python-projects/uppercase_and_reverse.py | iamvalentin23/onemonth | a44a4eb131824d9224170b55264902e63354da6e | [
"MIT"
] | null | null | null | python-projects/uppercase_and_reverse.py | iamvalentin23/onemonth | a44a4eb131824d9224170b55264902e63354da6e | [
"MIT"
] | null | null | null | # Create a function called uppercase_and_reverse that takes a little bit of text,
# uppercases it all, and then reverses it (flips all the letters around)
def uppercase_and_reverse(sentence):
return reverse(sentence.upper())
def reverse(sentence):
return sentence[::-1]
text = uppercase_and_reverse("Do not go gent... | 36.363636 | 112 | 0.77 |
5efb7f25110ae4597e0d57582d15f7aaf0538ba6 | 1,317 | py | Python | tests/cli/test_image.py | akx/markovchain | 9981ef327e70ba3e42f1a6c926f1252b47c29b48 | [
"MIT"
] | 16 | 2017-10-28T10:06:51.000Z | 2021-06-05T15:38:34.000Z | tests/cli/test_image.py | santhoshtr/markovchain | daf7273d15826b2555f92026ce1a999fb5906e37 | [
"MIT"
] | 1 | 2019-06-07T09:29:00.000Z | 2019-06-07T19:29:45.000Z | tests/cli/test_image.py | santhoshtr/markovchain | daf7273d15826b2555f92026ce1a999fb5906e37 | [
"MIT"
] | 6 | 2017-11-06T16:03:26.000Z | 2021-04-02T20:56:30.000Z | import os
import json
import pytest
from markovchain.cli.main import main
@pytest.mark.parametrize('fname,settings,data,args,res', [
])
def test_cli_image(mocker, mock_cli, fname, settings, data, args, res):
mock_cli(mocker)
statefile = os.path.join(mock_cli.dir, fname)
datafile = os.path.join(mock_cli.... | 28.630435 | 71 | 0.599848 |
a4758df8558a206a463b8db70b98cffac2dd3e90 | 792 | py | Python | venv/Scripts/f2py.py | Bandarban/Bandar_Bot | d185083bbeafa3d2002eace1122d595833130f19 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/f2py.py | Bandarban/Bandar_Bot | d185083bbeafa3d2002eace1122d595833130f19 | [
"Apache-2.0"
] | 4 | 2021-03-19T04:42:14.000Z | 2022-03-12T00:02:52.000Z | venv/Scripts/f2py.py | Bandarban/Bandar_Bot | d185083bbeafa3d2002eace1122d595833130f19 | [
"Apache-2.0"
] | null | null | null | #!C:\Users\Bandar\Bandar_Bot\venv\Scripts\python.exe
# See http://cens.ioc.ee/projects/f2py2e/
from __future__ import division, print_function
import os
import sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
try:
i = sys.argv.index("--" + mode)
del sys.argv[i]
break
... | 27.310345 | 67 | 0.643939 |
c365d9a90c5d7c68c4efb701b6b26f1d1fc8da0f | 5,132 | py | Python | pynetdicom/tests/test_dul.py | edmcdonagh/pynetdicom-1 | 9156c1adb34bb01580b9ba7247e78d699f38bbb7 | [
"MIT"
] | null | null | null | pynetdicom/tests/test_dul.py | edmcdonagh/pynetdicom-1 | 9156c1adb34bb01580b9ba7247e78d699f38bbb7 | [
"MIT"
] | null | null | null | pynetdicom/tests/test_dul.py | edmcdonagh/pynetdicom-1 | 9156c1adb34bb01580b9ba7247e78d699f38bbb7 | [
"MIT"
] | null | null | null | """DUL service testing"""
import logging
import socket
import threading
import time
import pytest
from pynetdicom import AE
from pynetdicom.dul import DULServiceProvider
from pynetdicom.pdu import A_ASSOCIATE_RQ, A_ASSOCIATE_AC, A_ASSOCIATE_RJ, \
A_RELEASE_RQ, A_RELEASE_RP, P_DATA_TF, A_A... | 29.66474 | 77 | 0.606002 |
7e7039e50d16f5fa222e0fe8f82bb1ef80c3491a | 3,746 | py | Python | server/metodos/interpolacion.py | sinedie/FinalProcesosNumericos | 082a3180cad5d9a32435ecb03b04d02dcf1a921f | [
"MIT"
] | null | null | null | server/metodos/interpolacion.py | sinedie/FinalProcesosNumericos | 082a3180cad5d9a32435ecb03b04d02dcf1a921f | [
"MIT"
] | null | null | null | server/metodos/interpolacion.py | sinedie/FinalProcesosNumericos | 082a3180cad5d9a32435ecb03b04d02dcf1a921f | [
"MIT"
] | null | null | null | import sympy
import numpy as np
from .utils import parse_pol
def lagrange(x, y):
n = len(x)
tabla = np.zeros((n, n))
for i in range(n):
Li = 1
den = 1
for j in range(n):
if j != i:
paux = [1, -x[j]]
Li = np.convolve(Li, paux)
... | 20.927374 | 79 | 0.368927 |
27965044f2e55e9370b616c858176d7675dd0687 | 456 | py | Python | backend/flask/run.py | mdda/2014-07_Singapore-Maritime-Hackathon | 0629f78f4214b5968c902ed2f3f98d872e6be998 | [
"MIT"
] | 1 | 2020-05-28T03:23:34.000Z | 2020-05-28T03:23:34.000Z | backend/flask/run.py | mdda/2014-07_Singapore-Maritime-Hackathon | 0629f78f4214b5968c902ed2f3f98d872e6be998 | [
"MIT"
] | null | null | null | backend/flask/run.py | mdda/2014-07_Singapore-Maritime-Hackathon | 0629f78f4214b5968c902ed2f3f98d872e6be998 | [
"MIT"
] | null | null | null | from www import app
HOST = 'localhost' # This restricts incoming calls to the local machine
#HOST = '0.0.0.0' # This allows incoming calls from outside the machine (Windows will ask for Firewall permission)
PORT = 7882 # Arbitrary port (epoch accessible from outside)
import os
debug=os.environ.get("FLA... | 32.571429 | 118 | 0.725877 |
f8afe19a39c310809941ec2a628ed0f07aee764d | 6,096 | py | Python | combined_phase1.py | ozgesevgili/n-hance | d8f967f8c866e28305ea24bd38021c66bf981d90 | [
"Apache-2.0"
] | 4 | 2019-02-06T13:06:56.000Z | 2022-02-01T09:09:03.000Z | combined_phase1.py | ozgesevgili/n-hance | d8f967f8c866e28305ea24bd38021c66bf981d90 | [
"Apache-2.0"
] | null | null | null | combined_phase1.py | ozgesevgili/n-hance | d8f967f8c866e28305ea24bd38021c66bf981d90 | [
"Apache-2.0"
] | null | null | null | import xml.etree.ElementTree as ET
import nltk
import string
import operator
from nltk.corpus import stopwords
# takes path and returns list of sentences.
def read_data(path="/Users/ozge/Documents/semeval2017_pun_task/data/test/subtask1-homographic-test.xml"):
result = list()
tree = ET.parse(path)
root = ... | 30.178218 | 107 | 0.658465 |
d60e0c19bff8c666f9e62aa26654c5e48d148bca | 21 | py | Python | kmapper/_version.py | deargle/kepler-mapper | 925f09c7016624ba93a5f30f15c2330a43524c3c | [
"MIT"
] | 167 | 2016-09-26T22:47:17.000Z | 2022-03-22T04:13:11.000Z | kmapper/_version.py | deargle/kepler-mapper | 925f09c7016624ba93a5f30f15c2330a43524c3c | [
"MIT"
] | 21 | 2016-09-26T05:25:03.000Z | 2021-08-30T13:51:06.000Z | kmapper/_version.py | deargle/kepler-mapper | 925f09c7016624ba93a5f30f15c2330a43524c3c | [
"MIT"
] | 22 | 2017-02-03T07:48:44.000Z | 2022-01-14T08:51:19.000Z | __version__ = "1.4.0" | 21 | 21 | 0.666667 |
398d834f21b2cf6e1f461cd6fe0d9fe95227eec6 | 4,507 | py | Python | docs/cunumeric/source/comparison/_comparison_generator.py | bryevdv/cunumeric | 7965ceb96d3252371c22cf32d38ac91c4db77a38 | [
"Apache-2.0"
] | null | null | null | docs/cunumeric/source/comparison/_comparison_generator.py | bryevdv/cunumeric | 7965ceb96d3252371c22cf32d38ac91c4db77a38 | [
"Apache-2.0"
] | null | null | null | docs/cunumeric/source/comparison/_comparison_generator.py | bryevdv/cunumeric | 7965ceb96d3252371c22cf32d38ac91c4db77a38 | [
"Apache-2.0"
] | null | null | null | import importlib
def _filter(obj, n):
try:
return (
n
not in [
"test",
"add_docstring",
"abs",
"add_newdoc",
"add_newdoc_ufunc",
"alen",
"alltrue",
"bitwi... | 27.993789 | 78 | 0.492789 |
dc8522ca6ef614219bed35bbb5ad5bb5d7a09847 | 11,624 | py | Python | my.py | Anantuo/pySpider | 5dbb707d750f5d01b20bd410b9f1d6e46b8a3f99 | [
"Apache-2.0"
] | 5 | 2016-06-15T10:43:03.000Z | 2019-11-29T07:39:54.000Z | my.py | Anantuo/pySpider | 5dbb707d750f5d01b20bd410b9f1d6e46b8a3f99 | [
"Apache-2.0"
] | null | null | null | my.py | Anantuo/pySpider | 5dbb707d750f5d01b20bd410b9f1d6e46b8a3f99 | [
"Apache-2.0"
] | 4 | 2016-01-15T14:22:40.000Z | 2019-04-17T03:35:55.000Z | from pyspider.libs.base_handler import *
from bs4 import BeautifulSoup
import cx_Oracle
import hashlib
import time
import re
import os
import redis
from urllib.parse import urljoin
from urllib.parse import urlparse
from urllib.parse import urlunparse
from urllib.parse import quote
'''放到/opt/pythontools下'''
class My(Bas... | 39.808219 | 132 | 0.467567 |
507f62fa5505ee4429b8005646cd139c236b0fb2 | 4,479 | py | Python | research/cv/squeezenet1_1/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/squeezenet1_1/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/squeezenet1_1/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 40.718182 | 93 | 0.652378 |
7ada29076bf1bfe5a7fa0fbbf9a72ef3e552749c | 1,210 | py | Python | src/polaris_follower/controllers/follower.py | jaskirat1208/turtlebot-polaris | fe40b0bcccaffab2ea2ba204905989ed81d69d14 | [
"BSD-2-Clause"
] | null | null | null | src/polaris_follower/controllers/follower.py | jaskirat1208/turtlebot-polaris | fe40b0bcccaffab2ea2ba204905989ed81d69d14 | [
"BSD-2-Clause"
] | null | null | null | src/polaris_follower/controllers/follower.py | jaskirat1208/turtlebot-polaris | fe40b0bcccaffab2ea2ba204905989ed81d69d14 | [
"BSD-2-Clause"
] | null | null | null | from time import sleep
import rospy
from polaris_follower.controllers.base_controller import BaseController
from polaris_follower.utils import Point
class Follower(BaseController):
"""
Given a robot, x, y coordinates of the destination, it reaches points x and y.
"""
def __init__(self, robot, planne... | 33.611111 | 97 | 0.636364 |
aa749cbae2aa9cfcef8d89f66e5316dd08477a0f | 3,222 | py | Python | src/abaqus/BoundaryCondition/FluidCavityPressureBCState.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/BoundaryCondition/FluidCavityPressureBCState.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/BoundaryCondition/FluidCavityPressureBCState.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from abaqusConstants import *
from .BoundaryConditionState import BoundaryConditionState
class FluidCavityPressureBCState(BoundaryConditionState):
"""The FluidCavityPressureBCState object stores the propagating data for a fluid cavity
pressure boundary condition in a step. One instance of this object is creat... | 37.905882 | 179 | 0.735258 |
b23895b8b7e4e1df295b3d487461bc777b37a7a7 | 6,528 | py | Python | qa/rpc-tests/receivedby.py | chratos-system/chratos-core | 26488032eff82a99b99c48bde31d3fbb1863f2f9 | [
"MIT"
] | null | null | null | qa/rpc-tests/receivedby.py | chratos-system/chratos-core | 26488032eff82a99b99c48bde31d3fbb1863f2f9 | [
"MIT"
] | 1 | 2018-08-21T01:15:56.000Z | 2018-08-21T01:15:56.000Z | qa/rpc-tests/receivedby.py | chratos-system/chratos-core | 26488032eff82a99b99c48bde31d3fbb1863f2f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listreceivedbyaddress API
from test_framework.test_framework import ChratosTestFramework
... | 43.231788 | 139 | 0.632966 |
2bdad1f6a9cff4c4b2371baf32133ce50a85d4f2 | 1,522 | py | Python | lib/scheduler.py | Toni-d-e-v/rxcsentinetal1 | 8af605f60cc6c6aa2b686d4e88fdc2051e0fc11e | [
"MIT"
] | null | null | null | lib/scheduler.py | Toni-d-e-v/rxcsentinetal1 | 8af605f60cc6c6aa2b686d4e88fdc2051e0fc11e | [
"MIT"
] | null | null | null | lib/scheduler.py | Toni-d-e-v/rxcsentinetal1 | 8af605f60cc6c6aa2b686d4e88fdc2051e0fc11e | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import init
import misc
from models import Transient
from misc import printdbg
import time
import random
class Scheduler(object):
transient_key_scheduled = 'NEXT_SENTINEL_CHECK_AT'
random_interval_max = 1... | 29.843137 | 84 | 0.684625 |
46301cac4d99a8d2585e852e307dd94eddfd43d6 | 3,704 | py | Python | app/action.py | hf-zhu/v2ex-action | 69675f72959b87b2052cea12ad6f4b2460c03d3b | [
"MIT"
] | null | null | null | app/action.py | hf-zhu/v2ex-action | 69675f72959b87b2052cea12ad6f4b2460c03d3b | [
"MIT"
] | null | null | null | app/action.py | hf-zhu/v2ex-action | 69675f72959b87b2052cea12ad6f4b2460c03d3b | [
"MIT"
] | null | null | null | import base64
import hashlib
import hmac
import json
import re
import time
import urllib.parse
import requests
import requests.packages.urllib3
from actions_toolkit import core
from app.util import now
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' \
'(KHTML, like Gecko) Ch... | 34.943396 | 97 | 0.517819 |
bf10e6f17727a302c60622e3c273c0e33ffdc269 | 495 | py | Python | Distributed Systems/Client Server/UDS Echo Server/solution.py | oleg-cherednik/hackerrank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 7 | 2020-04-02T16:18:46.000Z | 2021-02-12T14:06:44.000Z | Distributed Systems/Client Server/UDS Echo Server/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | null | null | null | Distributed Systems/Client Server/UDS Echo Server/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 11 | 2020-05-06T08:28:43.000Z | 2021-12-08T17:25:45.000Z | #!/usr/bin/env python2
import socket
import threading
def process_client_connection(connection):
while True:
message = connection.recv(4096)
connection.send(message)
if message == "END":
break
if __name__ == '__main__':
sock = socket.socket(socket.AF_UNIX)
sock.bind... | 20.625 | 86 | 0.648485 |
43595067ac485f02353b0a2ed25d07914ff69ad6 | 25,167 | py | Python | dist/weewx-3.9.2/bin/weewx/uwxutils.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 10 | 2017-01-05T17:30:48.000Z | 2021-09-18T15:04:20.000Z | dist/weewx-3.9.2/bin/weewx/uwxutils.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 2 | 2019-07-21T10:48:42.000Z | 2022-02-16T20:36:45.000Z | dist/weewx-3.9.2/bin/weewx/uwxutils.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 12 | 2017-01-05T18:50:30.000Z | 2021-10-05T07:35:45.000Z | # Adapted for use with weewx
#
# This source code may be freely used, including for commercial purposes
# Steve Hatchett info@softwx.com
# http:#www.softwx.org/weather
"""
Functions for performing various weather related calculations.
Notes about pressure
Sensor Pressure raw pressure indicated by the baro... | 47.574669 | 197 | 0.575635 |
19f212e38771cc1b741997b9c0bb954be88c1967 | 3,351 | py | Python | bot/constants.py | superik032/save-media-bot-1 | f1da929ce3fa345311e3dfa39ea95f777151b9c7 | [
"MIT"
] | 1 | 2021-11-29T12:28:59.000Z | 2021-11-29T12:28:59.000Z | bot/constants.py | superik032/save-media-bot-1 | f1da929ce3fa345311e3dfa39ea95f777151b9c7 | [
"MIT"
] | null | null | null | bot/constants.py | superik032/save-media-bot-1 | f1da929ce3fa345311e3dfa39ea95f777151b9c7 | [
"MIT"
] | null | null | null | from telegram import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup
USER_AGENT = (
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
' AppleWebKit/605.1.15 (KHTML, like Gecko) '
'Version/14.1.1 Safari/605.1.15'
)
class States:
prepare_mailing = 1
received_mailing = 2
class Cal... | 30.463636 | 108 | 0.661594 |
8e2d1a69917e4ef158c0c6332da1d9565ffdf60b | 4,649 | py | Python | otcextensions/sdk/anti_ddos/v1/status.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 9 | 2020-04-09T21:13:18.000Z | 2022-02-13T11:24:41.000Z | otcextensions/sdk/anti_ddos/v1/status.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 208 | 2020-02-10T08:27:46.000Z | 2022-03-29T15:24:21.000Z | otcextensions/sdk/anti_ddos/v1/status.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 15 | 2020-04-01T20:45:54.000Z | 2022-03-23T12:45:43.000Z | # 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... | 30.385621 | 76 | 0.666595 |
6f168b02bb5efbf92750fbb2bf54c5435c68ff58 | 18,031 | py | Python | tests/test_lstm.py | kadeng/tensorflow-onnx | db91f5b25cc2a053f46af3b2c04b65a679cff03b | [
"MIT"
] | null | null | null | tests/test_lstm.py | kadeng/tensorflow-onnx | db91f5b25cc2a053f46af3b2c04b65a679cff03b | [
"MIT"
] | null | null | null | tests/test_lstm.py | kadeng/tensorflow-onnx | db91f5b25cc2a053f46af3b2c04b65a679cff03b | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
"""Unit Tests for lstm."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import numpy as np
import tenso... | 36.797959 | 119 | 0.603294 |
383f001dc15f860710c28fcbb9f65be4685c766f | 2,783 | py | Python | testsuite/driver/src/target_parser/common_parse.py | openmaple/MapleCompiler | 1648e63144766563f1ec44a25e0b618415648627 | [
"MulanPSL-1.0"
] | 5 | 2019-09-02T04:44:52.000Z | 2021-11-08T12:23:51.000Z | testsuite/driver/src/target_parser/common_parse.py | venshine/OpenArkCompiler | 264cd4463834356658154f0d254672ef559f245f | [
"MulanPSL-1.0"
] | 2 | 2020-07-21T01:22:01.000Z | 2021-12-06T08:07:16.000Z | testsuite/driver/src/target_parser/common_parse.py | venshine/OpenArkCompiler | 264cd4463834356658154f0d254672ef559f245f | [
"MulanPSL-1.0"
] | 4 | 2019-09-02T04:46:52.000Z | 2020-09-10T11:30:03.000Z | #
# Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved.
#
# OpenArkCompiler is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WA... | 41.537313 | 134 | 0.620913 |
c06213aeb84aaf7311a3a838d2adc1bd3e423e04 | 6,413 | py | Python | xsdata/formats/dataclass/context.py | nimish/xsdata | 7afe2781b66982428cc1731f53c065086acd35c1 | [
"MIT"
] | null | null | null | xsdata/formats/dataclass/context.py | nimish/xsdata | 7afe2781b66982428cc1731f53c065086acd35c1 | [
"MIT"
] | null | null | null | xsdata/formats/dataclass/context.py | nimish/xsdata | 7afe2781b66982428cc1731f53c065086acd35c1 | [
"MIT"
] | null | null | null | import sys
from dataclasses import dataclass
from dataclasses import Field
from dataclasses import field
from dataclasses import fields
from dataclasses import is_dataclass
from dataclasses import MISSING
from typing import Any
from typing import Callable
from typing import Dict
from typing import get_type_hints
from t... | 33.227979 | 88 | 0.601279 |
6abb2fb142bbad67e8c8ec340b4561a5d5657baa | 2,997 | py | Python | templates/template.py | cisaacstern/when-rad | ea97d77be0ff227494ce5eb168872f397ee4f064 | [
"BSD-3-Clause"
] | null | null | null | templates/template.py | cisaacstern/when-rad | ea97d77be0ff227494ce5eb168872f397ee4f064 | [
"BSD-3-Clause"
] | null | null | null | templates/template.py | cisaacstern/when-rad | ea97d77be0ff227494ce5eb168872f397ee4f064 | [
"BSD-3-Clause"
] | null | null | null | template = """
{% extends base %}
<!-- goes in body -->
{% block postamble %}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel='stylesheet' href='//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack-subset.css'>
<link rel="stylesheet" type="text/css" hr... | 51.672414 | 1,588 | 0.635636 |
100c781247ba83e3b1a1a8a1aa7b426840b7a936 | 2,717 | py | Python | analyze/visualizer.py | wtrnoguchi/superposition | a3ce049000ea8b014c4cac1bfe84d8b399862ef9 | [
"MIT"
] | 2 | 2022-03-09T21:33:46.000Z | 2022-03-12T06:14:41.000Z | analyze/visualizer.py | wtrnoguchi/superposition | a3ce049000ea8b014c4cac1bfe84d8b399862ef9 | [
"MIT"
] | null | null | null | analyze/visualizer.py | wtrnoguchi/superposition | a3ce049000ea8b014c4cac1bfe84d8b399862ef9 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy
import analyze_util
class Visualizer(object):
def __init__(self, field_size):
self.field_size = field_size
self.colormap = analyze_util.make2Dcolormap(size=self.field_size * 2)
def save_png(self, f_base):
self.fig.savefig(f_base + '.png')
... | 30.188889 | 78 | 0.556864 |
8acc3efba07efe16df72c1564e3cb2c66530c0e8 | 896 | py | Python | translate.py | aqaqsubin/AMR2Text-summ | 163548c0dbb3e4ca4f83cd59b74b8e5515898d1b | [
"MIT"
] | 24 | 2018-08-29T08:27:49.000Z | 2021-07-18T16:25:37.000Z | translate.py | aqaqsubin/AMR2Text-summ | 163548c0dbb3e4ca4f83cd59b74b8e5515898d1b | [
"MIT"
] | 2 | 2019-09-10T09:00:41.000Z | 2020-12-17T09:10:54.000Z | translate.py | aqaqsubin/AMR2Text-summ | 163548c0dbb3e4ca4f83cd59b74b8e5515898d1b | [
"MIT"
] | 6 | 2018-09-01T14:14:12.000Z | 2021-07-20T07:13:24.000Z | #!/usr/bin/env python
from __future__ import division, unicode_literals
import argparse
from onmt.translate.Translator import make_translator
import onmt.io
import onmt.translate
import onmt
import onmt.ModelConstructor
import onmt.modules
import onmt.opts
def main(opt):
translator = make_translator(opt, report... | 28.903226 | 107 | 0.726563 |
28ecc59bc042e3f4b5ed20c0ca164be66ec2f770 | 27,790 | py | Python | tests/fruit_test_common.py | TinkerBoard-Android/external-google-fruit | 57123c8a2477a4d99cb68c53d195e9fb428dd535 | [
"Apache-2.0"
] | null | null | null | tests/fruit_test_common.py | TinkerBoard-Android/external-google-fruit | 57123c8a2477a4d99cb68c53d195e9fb428dd535 | [
"Apache-2.0"
] | null | null | null | tests/fruit_test_common.py | TinkerBoard-Android/external-google-fruit | 57123c8a2477a4d99cb68c53d195e9fb428dd535 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 44.894992 | 202 | 0.680461 |
0809ee7a2936ce5c74b442b27ae28e550567e78e | 17,898 | py | Python | supervisor/addons/validate.py | mories76/supervisor | fb7bc6bd970fada6c75e3c58c71725fdf44cd1e3 | [
"Apache-2.0"
] | 24 | 2020-03-08T21:13:00.000Z | 2020-03-11T06:18:43.000Z | supervisor/addons/validate.py | mories76/supervisor | fb7bc6bd970fada6c75e3c58c71725fdf44cd1e3 | [
"Apache-2.0"
] | null | null | null | supervisor/addons/validate.py | mories76/supervisor | fb7bc6bd970fada6c75e3c58c71725fdf44cd1e3 | [
"Apache-2.0"
] | null | null | null | """Validate add-ons options schema."""
import logging
import re
import secrets
from typing import Any, Dict, List
import uuid
import voluptuous as vol
from ..const import (
ARCH_ALL,
ATTR_ACCESS_TOKEN,
ATTR_ADVANCED,
ATTR_APPARMOR,
ATTR_ARCH,
ATTR_ARGS,
ATTR_AUDIO,
ATTR_AUDIO_INPUT,
... | 31.126957 | 88 | 0.611018 |
b9c1c83a1855e6dff9f1e177e93ee2ff75ce2dc4 | 7,057 | py | Python | lmnet/configs/core/object_detection/yolo_v2_pascalvoc_2007_2012.py | progrunner17/blueoil | 5cbe8b2ceebaaa7a6582a377031ae92855bed0aa | [
"Apache-2.0"
] | null | null | null | lmnet/configs/core/object_detection/yolo_v2_pascalvoc_2007_2012.py | progrunner17/blueoil | 5cbe8b2ceebaaa7a6582a377031ae92855bed0aa | [
"Apache-2.0"
] | null | null | null | lmnet/configs/core/object_detection/yolo_v2_pascalvoc_2007_2012.py | progrunner17/blueoil | 5cbe8b2ceebaaa7a6582a377031ae92855bed0aa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | 28.686992 | 109 | 0.687544 |
4a116616f1dc8b47b1cfbd310e858127e6794149 | 898 | py | Python | mythirdpjt.py | helloworldtang/python-spider-study | b65bc646e716bd3cd421aa9c395507fded7aff06 | [
"Apache-2.0"
] | null | null | null | mythirdpjt.py | helloworldtang/python-spider-study | b65bc646e716bd3cd421aa9c395507fded7aff06 | [
"Apache-2.0"
] | null | null | null | mythirdpjt.py | helloworldtang/python-spider-study | b65bc646e716bd3cd421aa9c395507fded7aff06 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__title__ = ''
__author__ = 'tangcheng'
__mtime__ = '12/12/2017'
"""
import urllib.request
import re
from db.DBUtil import persist
def getContent(url):
headers = ("User-Agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, ... | 24.944444 | 132 | 0.640312 |
5dcdf04c37cbf0a856bf2b8b55f46b8b9fa56ac3 | 9,951 | py | Python | harmony/http.py | bilts/harmony-service-lib-py | 6eb358539adab9510d75158737de2b55fba85f91 | [
"Apache-2.0"
] | null | null | null | harmony/http.py | bilts/harmony-service-lib-py | 6eb358539adab9510d75158737de2b55fba85f91 | [
"Apache-2.0"
] | null | null | null | harmony/http.py | bilts/harmony-service-lib-py | 6eb358539adab9510d75158737de2b55fba85f91 | [
"Apache-2.0"
] | null | null | null | """
Utility functions to download data from backend data sources so it can be operated on
locally.
When downloading from an EDL-token aware data source, this module uses EDL shared /
federated token authentication. It includes an optional fallback authentication that
uses an EDL user to download data when the feature ... | 34.195876 | 100 | 0.685157 |
65a3315d93d1fe6017094910d4a47f8d7a0c69e8 | 13,185 | py | Python | models/model_wgan_bicubic256.py | opteroncx/DGDMLSR | c54d60ff6f5feb8f8ecba73e78bcc70fc533035f | [
"Apache-2.0"
] | 2 | 2020-09-11T10:22:45.000Z | 2021-07-14T01:56:17.000Z | models/model_wgan_bicubic256.py | opteroncx/DGDMLSR | c54d60ff6f5feb8f8ecba73e78bcc70fc533035f | [
"Apache-2.0"
] | 1 | 2021-07-14T02:09:47.000Z | 2021-07-14T05:48:21.000Z | models/model_wgan_bicubic256.py | opteroncx/DGDMLSR | c54d60ff6f5feb8f8ecba73e78bcc70fc533035f | [
"Apache-2.0"
] | 1 | 2022-01-15T15:06:35.000Z | 2022-01-15T15:06:35.000Z | import torch
import torch.nn as nn
import numpy as np
import math
def get_upsample_filter(size):
"""Make a 2D bilinear kernel suitable for upsampling"""
factor = (size + 1) // 2
if size % 2 == 1:
center = factor - 1
else:
center = factor - 0.5
og = np.ogrid[:size, :size]
filter ... | 40.947205 | 123 | 0.571104 |
1a007f4d95b4972cfa3fbf28bd88ac00321c3813 | 3,353 | py | Python | ckanext-hdx_service_checker/setup.py | OCHA-DAP/hdx-ckan | 202e0c44adc4ea8d0b90141e69365b65cce68672 | [
"Apache-2.0"
] | 58 | 2015-01-11T09:05:15.000Z | 2022-03-17T23:44:07.000Z | ckanext-hdx_service_checker/setup.py | OCHA-DAP/hdx-ckan | 202e0c44adc4ea8d0b90141e69365b65cce68672 | [
"Apache-2.0"
] | 1,467 | 2015-01-01T16:47:44.000Z | 2022-02-28T16:51:20.000Z | ckanext-hdx_service_checker/setup.py | OCHA-DAP/hdx-ckan | 202e0c44adc4ea8d0b90141e69365b65cce68672 | [
"Apache-2.0"
] | 17 | 2015-05-06T14:04:21.000Z | 2021-11-11T19:58:16.000Z | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as... | 38.988372 | 116 | 0.690725 |
39c3360de5ed5436c13f0b5c11ff3ff8f4c1e5e8 | 935 | py | Python | python3/max_area_of_island.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | 1 | 2020-10-08T09:17:40.000Z | 2020-10-08T09:17:40.000Z | python3/max_area_of_island.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | python3/max_area_of_island.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | # Space : O(n)
# Time : O(m*n)
class Solution:
def crawl(self, grid, x, y):
def bfs(dx, dy):
nonlocal area
if grid[dy][dx] == 1:
area += 1
grid[dy][dx] = 0
elif grid[dy][dx] == 0:
return
for ax, ay in c... | 25.972222 | 61 | 0.37754 |
da4ac95bf0af04b68e4aba2a40f2badc99ff9cb4 | 2,023 | py | Python | openpype/helpers/deploy_project.py | pypeclub/openpype4-backend | a0abe2ed66887c6529b01bbb9cb00278bbff41e4 | [
"Apache-2.0"
] | 2 | 2022-03-09T08:02:52.000Z | 2022-03-15T00:34:01.000Z | openpype/helpers/deploy_project.py | pypeclub/openpype4-backend | a0abe2ed66887c6529b01bbb9cb00278bbff41e4 | [
"Apache-2.0"
] | 1 | 2022-03-08T16:22:34.000Z | 2022-03-08T16:22:34.000Z | openpype/helpers/deploy_project.py | pypeclub/openpype4-backend | a0abe2ed66887c6529b01bbb9cb00278bbff41e4 | [
"Apache-2.0"
] | null | null | null | from typing import Any
from openpype.entities.project import ProjectEntity
from openpype.settings.anatomy import Anatomy
async def create_project_from_anatomy(
name: str,
code: str,
anatomy: Anatomy,
library: bool = False,
) -> None:
"""Deploy a project."""
task_types = {}
for task_type ... | 26.973333 | 75 | 0.554622 |
b061d41f3827ee5e1a10da7afe6efefd3f47d402 | 32,841 | py | Python | nmt/nmt.py | adorableChowhound/nmt | 35483dd9a9935dc0e9b1a450efa304dfdfc2fa76 | [
"Apache-2.0"
] | 4 | 2020-10-13T07:24:15.000Z | 2021-12-31T02:00:43.000Z | nmt/nmt.py | adorableChowhound/nmt | 35483dd9a9935dc0e9b1a450efa304dfdfc2fa76 | [
"Apache-2.0"
] | null | null | null | nmt/nmt.py | adorableChowhound/nmt | 35483dd9a9935dc0e9b1a450efa304dfdfc2fa76 | [
"Apache-2.0"
] | 1 | 2020-10-14T04:59:24.000Z | 2020-10-14T04:59:24.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 45.48615 | 113 | 0.623885 |
2a5a1629bc3fe54e5aa2085a36d4e0d8fc7907a5 | 835 | py | Python | tweets/serializers.py | LuisManuelGlz/twitter-clone-server | a794f3322b9a02b480f026e4ce1342f9c4641d7d | [
"MIT"
] | null | null | null | tweets/serializers.py | LuisManuelGlz/twitter-clone-server | a794f3322b9a02b480f026e4ce1342f9c4641d7d | [
"MIT"
] | null | null | null | tweets/serializers.py | LuisManuelGlz/twitter-clone-server | a794f3322b9a02b480f026e4ce1342f9c4641d7d | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Tweet
from users.serializers import UserSerializer
class TweetSimpleSerializer(serializers.ModelSerializer):
user = UserSerializer(read_only=True)
class Meta:
model = Tweet
fields = ['id', 'content', 'user', 'likes_total', 'created_at']
class T... | 23.857143 | 67 | 0.705389 |
96104880265137ae45274e8e2254ea541f8f5f13 | 15,457 | py | Python | PINNFramework/PINN.py | albernsrya/NeuralSolvers | d044ffd6d74ab7814e2e86fc41949ad04688e06a | [
"MIT"
] | null | null | null | PINNFramework/PINN.py | albernsrya/NeuralSolvers | d044ffd6d74ab7814e2e86fc41949ad04688e06a | [
"MIT"
] | null | null | null | PINNFramework/PINN.py | albernsrya/NeuralSolvers | d044ffd6d74ab7814e2e86fc41949ad04688e06a | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from itertools import chain
from torch.utils.data import DataLoader
from .InitalCondition import InitialCondition
from .BoundaryCondition import BoundaryCondition, PeriodicBC, DirichletBC, NeumannBC, RobinBC
from .PDELoss import PDELoss
from .JoinedDataset import JoinedDataset
from .H... | 47.56 | 120 | 0.620043 |
a144ef38167a114a0bb30209e21539d0a06f6275 | 3,407 | py | Python | tests/test_summary.py | jianxiongcai/tensorboardX | c2fa5959d08ee1d7d59f89f6f8fbe9788ca81a2d | [
"MIT"
] | null | null | null | tests/test_summary.py | jianxiongcai/tensorboardX | c2fa5959d08ee1d7d59f89f6f8fbe9788ca81a2d | [
"MIT"
] | null | null | null | tests/test_summary.py | jianxiongcai/tensorboardX | c2fa5959d08ee1d7d59f89f6f8fbe9788ca81a2d | [
"MIT"
] | null | null | null | from tensorboardX import summary
from .expect_reader import compare_proto
import numpy as np
import pytest
import unittest
np.random.seed(0)
# compare_proto = write_proto # massive update expect
class SummaryTest(unittest.TestCase):
def test_uint8_image(self):
'''
Tests that uint8 image (pixel val... | 40.559524 | 118 | 0.643088 |
b3be691c031f960f5e3f0f813b928c8aae5fa63f | 447 | py | Python | users/migrations/0004_auto_20210311_1636.py | mdpe-ir/mdCms | 69aea3687a2b9d7846b196c00a0cd3866c54fd4c | [
"BSD-3-Clause-Attribution"
] | 1 | 2021-03-09T19:03:35.000Z | 2021-03-09T19:03:35.000Z | users/migrations/0004_auto_20210311_1636.py | mdpe-ir/mdCms | 69aea3687a2b9d7846b196c00a0cd3866c54fd4c | [
"BSD-3-Clause-Attribution"
] | null | null | null | users/migrations/0004_auto_20210311_1636.py | mdpe-ir/mdCms | 69aea3687a2b9d7846b196c00a0cd3866c54fd4c | [
"BSD-3-Clause-Attribution"
] | 1 | 2021-11-13T06:04:33.000Z | 2021-11-13T06:04:33.000Z | # Generated by Django 3.1.7 on 2021-03-11 13:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_20210310_1255'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='image',
... | 23.526316 | 113 | 0.61745 |
d5e91ace10306bbe6a6503d1ae98cd15f9d5f6f1 | 5,271 | py | Python | src/scripts/retrieval/ner/get_ner.py | RahulRoyMattam/fever-baselines | 8977ffd939dbdb17bf4f190d45f11dabb7755668 | [
"Apache-2.0"
] | null | null | null | src/scripts/retrieval/ner/get_ner.py | RahulRoyMattam/fever-baselines | 8977ffd939dbdb17bf4f190d45f11dabb7755668 | [
"Apache-2.0"
] | null | null | null | src/scripts/retrieval/ner/get_ner.py | RahulRoyMattam/fever-baselines | 8977ffd939dbdb17bf4f190d45f11dabb7755668 | [
"Apache-2.0"
] | 1 | 2019-06-12T18:25:08.000Z | 2019-06-12T18:25:08.000Z | import argparse
import json
import logging
import http.client
import urllib.parse
import datetime
import time
from tqdm import tqdm
from flair.models import SequenceTagger
from flair.data import Sentence
from common.dataset.reader import JSONLineReader
from common.util.random import SimpleRandom
from retrieval.fever_do... | 37.382979 | 145 | 0.579586 |
2e3244fb0d34fd5953bbfd4a90e58f0cb60a0949 | 155,070 | py | Python | angr/analyses/cfg/cfg_fast.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:39:11.000Z | 2020-11-18T16:39:11.000Z | angr/analyses/cfg/cfg_fast.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/cfg/cfg_fast.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:39:13.000Z | 2020-11-18T16:39:13.000Z | import itertools
import logging
import math
import re
import string
from collections import defaultdict, OrderedDict
from sortedcontainers import SortedDict
import claripy
import cle
import pyvex
from cle.address_translator import AT
from archinfo.arch_soot import SootAddressDescriptor
from archinfo.arch_arm import i... | 43.424811 | 162 | 0.576611 |
4c318031cf0012164ac6e0443fc731e0283d7cd6 | 3,552 | py | Python | huaweicloud-sdk-kms/huaweicloudsdkkms/v1/model/create_parameters_for_import_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-kms/huaweicloudsdkkms/v1/model/create_parameters_for_import_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-kms/huaweicloudsdkkms/v1/model/create_parameters_for_import_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class CreateParametersForImportRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
... | 26.311111 | 83 | 0.569538 |
e2f0940599d79286ca9cd21789dd493026f48112 | 689 | py | Python | scripts/deployment/export/export_pretrained.py | Kh4L/gluon-cv | 849411ed56632cd854850b07142087d599f97dcb | [
"Apache-2.0"
] | 5,447 | 2018-04-25T18:02:51.000Z | 2022-03-31T00:59:49.000Z | scripts/deployment/export/export_pretrained.py | Kh4L/gluon-cv | 849411ed56632cd854850b07142087d599f97dcb | [
"Apache-2.0"
] | 1,566 | 2018-04-25T21:14:04.000Z | 2022-03-31T06:42:42.000Z | scripts/deployment/export/export_pretrained.py | Kh4L/gluon-cv | 849411ed56632cd854850b07142087d599f97dcb | [
"Apache-2.0"
] | 1,345 | 2018-04-25T18:44:13.000Z | 2022-03-30T19:32:53.000Z | """Script for export pre-trained models in GluonCV model zoo."""
from __future__ import print_function
import argparse
import gluoncv as gcv
gcv.utils.check_version('0.6.0')
def parse_args():
parser = argparse.ArgumentParser("Export model helper.")
parser.add_argument('--model', '-m', required=True, type=str, ... | 38.277778 | 107 | 0.7373 |
245f7f7c64201308624e4ce0bca706ffafbe0fa2 | 8,736 | py | Python | endesive/hsm.py | spitoglou/endesive | 36c4dadbdf1f297e72fd653b0f5f792a4d238857 | [
"MIT"
] | null | null | null | endesive/hsm.py | spitoglou/endesive | 36c4dadbdf1f297e72fd653b0f5f792a4d238857 | [
"MIT"
] | null | null | null | endesive/hsm.py | spitoglou/endesive | 36c4dadbdf1f297e72fd653b0f5f792a4d238857 | [
"MIT"
] | null | null | null | #!/usr/bin/env vpython3
# coding: utf-8
import os
import sys
import binascii
import datetime
import PyKCS11
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primit... | 40.632558 | 133 | 0.610691 |
ce0c31c55afa89fc8de20cb8cab31ac0f2a98994 | 5,621 | py | Python | dask_image/ndfilters/_utils.py | akhalighi/dask-image | 8ff0f16dba8a874c7d8d3adf4e5e8bac5f4ee1bf | [
"BSD-3-Clause"
] | null | null | null | dask_image/ndfilters/_utils.py | akhalighi/dask-image | 8ff0f16dba8a874c7d8d3adf4e5e8bac5f4ee1bf | [
"BSD-3-Clause"
] | null | null | null | dask_image/ndfilters/_utils.py | akhalighi/dask-image | 8ff0f16dba8a874c7d8d3adf4e5e8bac5f4ee1bf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
import collections
import inspect
import numbers
import re
import numpy
from .._pycompat import irange, izip, strlike
def _get_docstring(func):
# Drop the output parameter from the docstring.
split_doc_params = lambda s: re.subn( ... | 30.22043 | 79 | 0.644191 |
7ade909570889192a40a375c113ccd1a77e7fdc3 | 12,207 | py | Python | pointnet2/pointnet2_utils.py | StannisZhou/votenet | 20c6de8f6c0ca32ceb1fccad2f8e5cfa936fdc2e | [
"MIT"
] | 1,479 | 2019-08-22T20:10:42.000Z | 2022-03-29T01:36:03.000Z | pointnet2/pointnet2_utils.py | StannisZhou/votenet | 20c6de8f6c0ca32ceb1fccad2f8e5cfa936fdc2e | [
"MIT"
] | 145 | 2019-08-23T08:03:39.000Z | 2022-03-26T09:54:17.000Z | pointnet2/pointnet2_utils.py | StannisZhou/votenet | 20c6de8f6c0ca32ceb1fccad2f8e5cfa936fdc2e | [
"MIT"
] | 351 | 2019-08-23T02:39:17.000Z | 2022-03-06T13:22:49.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
''' Modified based on: https://github.com/erikwijmans/Pointnet2_PyTorch '''
from __future__ import (
division,
absolute_import,
w... | 28.65493 | 144 | 0.579176 |
c9542c54e83e65e20a247adc8bc860da9b9b720a | 2,979 | py | Python | monasca-events-api-0.3.0/monasca_events_api/app/healthcheck/kafka_check.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 13 | 2016-09-14T22:02:36.000Z | 2019-01-28T22:04:44.000Z | monasca-events-api-0.3.0/monasca_events_api/app/healthcheck/kafka_check.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | monasca-events-api-0.3.0/monasca_events_api/app/healthcheck/kafka_check.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 3 | 2017-07-27T11:44:35.000Z | 2018-07-10T12:11:39.000Z | # Copyright 2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 31.357895 | 75 | 0.684458 |
422b6bddc40d34b06604847f56bacf021190e919 | 42,614 | py | Python | cinder/volume/drivers/ibm/flashsystem_common.py | UbuntuEvangelist/cinder | cbb55074de48176cbaa3f31a5b1d595b8aad7aa8 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/ibm/flashsystem_common.py | UbuntuEvangelist/cinder | cbb55074de48176cbaa3f31a5b1d595b8aad7aa8 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/ibm/flashsystem_common.py | UbuntuEvangelist/cinder | cbb55074de48176cbaa3f31a5b1d595b8aad7aa8 | [
"Apache-2.0"
] | 15 | 2017-01-12T10:35:10.000Z | 2019-04-19T08:22:10.000Z | # Copyright 2015 IBM 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 39.384473 | 79 | 0.575468 |
d92d189ddc19307435bb2833bb300b5f392cfb29 | 7,332 | py | Python | env/lib/python3.5/site-packages/sklearn/externals/joblib/externals/loky/backend/spawn.py | Udolf15/recommedMeMovies | be5ae74acd98e3f93beaaa5bb55623974fb24247 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | venv/lib/python3.7/site-packages/sklearn/externals/joblib/externals/loky/backend/spawn.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | venv/lib/python3.7/site-packages/sklearn/externals/joblib/externals/loky/backend/spawn.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 3 | 2019-06-13T07:10:54.000Z | 2020-09-11T06:01:40.000Z | ###############################################################################
# Prepares and processes the data to setup the new process environment
#
# author: Thomas Moreau and Olivier Grisel
#
# adapted from multiprocessing/spawn.py (17/02/2017)
# * Improve logging data
#
import os
import sys
import runpy
import ... | 32.732143 | 79 | 0.652209 |
2c0f7103056d35d30b31af61fbc60510eb9f97a5 | 6,249 | py | Python | release/stubs.min/Wms/RemotingObjects/BackgroundAgents.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/Wms/RemotingObjects/BackgroundAgents.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/Wms/RemotingObjects/BackgroundAgents.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | # encoding: utf-8
# module Wms.RemotingObjects.BackgroundAgents calls itself BackgroundAgents
# from Wms.RemotingObjects,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no important
from __init__ import *
# no functions
# classes
class BackgroundAgent(DbObject):
""" B... | 30.043269 | 215 | 0.68779 |
c1b8a9677878622f4e0a5a7a818a11957e70fd4c | 1,435 | py | Python | plotly/validators/layout/ternary/baxis/_tickfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2018-07-16T01:51:47.000Z | 2018-07-16T01:51:47.000Z | plotly/validators/layout/ternary/baxis/_tickfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/layout/ternary/baxis/_tickfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name='tickfont',
parent_name='layout.ternary.baxis',
**kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plo... | 36.794872 | 72 | 0.560976 |
aa7aa94a876dcc6aa57aa83f2949de86347dc542 | 751 | py | Python | client/verta/verta/_swagger/_public/modeldb/versioning/model/VersioningBlobDiff.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/modeldb/versioning/model/VersioningBlobDiff.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/modeldb/versioning/model/VersioningBlobDiff.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class VersioningBlobDiff(BaseType):
def __init__(self, path=None, dataset=None):
required = {
"path": False,
"dataset": False,
}
self.path = path
self.dataset = dataset
for k, v in required.items... | 24.225806 | 62 | 0.647137 |
a91719a90068092138f19bbb74eecd515070a1cb | 7,818 | py | Python | pycaret/tests/test_classification.py | hanaseleb/pycaret | 1fe6e1a6bee642351c4b6064d769f97294713f48 | [
"MIT"
] | 1 | 2022-03-29T19:35:35.000Z | 2022-03-29T19:35:35.000Z | pycaret/tests/test_classification.py | hanaseleb/pycaret | 1fe6e1a6bee642351c4b6064d769f97294713f48 | [
"MIT"
] | null | null | null | pycaret/tests/test_classification.py | hanaseleb/pycaret | 1fe6e1a6bee642351c4b6064d769f97294713f48 | [
"MIT"
] | 1 | 2022-03-15T13:56:16.000Z | 2022-03-15T13:56:16.000Z | import os, sys
sys.path.insert(0, os.path.abspath(".."))
import pandas as pd
import pytest
import pycaret.classification
import pycaret.datasets
from mlflow.tracking.client import MlflowClient
import uuid
@pytest.fixture(scope='module')
def juice_dataframe():
# loading dataset
return pycaret.datasets.get_dat... | 34.440529 | 130 | 0.647608 |
33f0ebb48427cb74ab5dbb7e7b345df772a88eba | 2,222 | py | Python | xgboost-sys/xgboost/tests/python/test_updaters.py | MashPlant/rust-xgboost | 8a91943e284fece347f8b38fffca70325adbcdfd | [
"MIT"
] | 769 | 2015-01-02T03:15:00.000Z | 2022-03-30T11:22:52.000Z | xgboost-sys/xgboost/tests/python/test_updaters.py | MashPlant/rust-xgboost | 8a91943e284fece347f8b38fffca70325adbcdfd | [
"MIT"
] | 54 | 2015-01-01T01:12:39.000Z | 2017-05-21T02:56:14.000Z | xgboost-sys/xgboost/tests/python/test_updaters.py | MashPlant/rust-xgboost | 8a91943e284fece347f8b38fffca70325adbcdfd | [
"MIT"
] | 372 | 2015-01-03T21:10:27.000Z | 2022-03-03T03:46:36.000Z | import testing as tm
import unittest
import xgboost as xgb
try:
from regression_test_utilities import run_suite, parameter_combinations, \
assert_results_non_increasing
except ImportError:
None
class TestUpdaters(unittest.TestCase):
def test_histmaker(self):
tm._skip_if_no_sklearn()
... | 39.678571 | 92 | 0.589559 |
582c0f3286ffa21f251ad285c5e669e66b998bda | 1,647 | py | Python | core-python-basic-knowledge/file_io_and_resource_management/files.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | 1 | 2022-03-09T20:58:33.000Z | 2022-03-09T20:58:33.000Z | core-python-basic-knowledge/file_io_and_resource_management/files.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | null | null | null | core-python-basic-knowledge/file_io_and_resource_management/files.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | null | null | null | """
open()
-> Open a file for reading or writing
-> file: the path to the file (required)
-> mode: read, write, or append, plus binary or text
-> encoding: encoding to use in text mode
open() Modes
Mode 'r' -> open for reading
Mode 'w' -> open for writing
Mode 'a -> open for appending
Selector 'b' -> binary mode
Selec... | 23.869565 | 93 | 0.672738 |
8effa1cff4085b4c9ac1890017c0a69a9f860c57 | 24,339 | py | Python | test/test_trace_events.py | runtime-jupyter-safety/runtime-jupyter-safety | f62a24b5b4f44fed5111c31441bc6a105441e34c | [
"BSD-3-Clause"
] | null | null | null | test/test_trace_events.py | runtime-jupyter-safety/runtime-jupyter-safety | f62a24b5b4f44fed5111c31441bc6a105441e34c | [
"BSD-3-Clause"
] | 20 | 2020-04-17T02:32:50.000Z | 2020-05-07T05:50:32.000Z | test/test_trace_events.py | runtime-jupyter-safety/runtime-jupyter-safety | f62a24b5b4f44fed5111c31441bc6a105441e34c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import difflib
import functools
import logging
from types import FrameType
from typing import List, Set, Union
import hypothesis.strategies as st
from hypothesis import example, given, settings
from nbsafety.safety import NotebookSafety
from nbsafety.singletons import tracer
from nbsafety.trac... | 33.432692 | 84 | 0.57755 |
d19b38d1cfd2b800edd3b6748bd4f3877a27ce18 | 3,982 | py | Python | lambda/lambda_function.py | alshapton/Space-X-Info-Alexa | 05d2f7a3c0bf6151c6c3ccab358eb432e47a93a6 | [
"MIT"
] | null | null | null | lambda/lambda_function.py | alshapton/Space-X-Info-Alexa | 05d2f7a3c0bf6151c6c3ccab358eb432e47a93a6 | [
"MIT"
] | null | null | null | lambda/lambda_function.py | alshapton/Space-X-Info-Alexa | 05d2f7a3c0bf6151c6c3ccab358eb432e47a93a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#import boto3
import logging
import ask_sdk_core.utils as ask_utils
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.dispatch_components import AbstractRequestHandler
from ask_sdk_core.dispatch_components import AbstractExceptionHandler
from ask_sdk_core.handler_inp... | 40.632653 | 151 | 0.801105 |
392fd4d7d4ab0ef07297911fa104492a550448f4 | 10,015 | py | Python | body/body_textEditor.py | XiantaoCheng/Structure | 5a12452dbe03fd37baf3059578cd1dd10f25e161 | [
"MIT"
] | 1 | 2020-01-15T02:02:59.000Z | 2020-01-15T02:02:59.000Z | body/body_textEditor.py | XiantaoCheng/Structure | 5a12452dbe03fd37baf3059578cd1dd10f25e161 | [
"MIT"
] | null | null | null | body/body_textEditor.py | XiantaoCheng/Structure | 5a12452dbe03fd37baf3059578cd1dd10f25e161 | [
"MIT"
] | null | null | null | import sys, re
if __name__=='__main__':
sys.path.append(sys.path[0]+'\\..')
from body.bone import NetP
from body.soul import Karma
from body.body_motor import Motor
from body.body_pool import Pool
from body.body_brain import Brain
from body.body_debugger import Debugger
from tools import tools_sl, tools_ba... | 33.383333 | 93 | 0.582227 |
bf89386e68d59623351cdaf351f5250358ce932f | 14,315 | py | Python | marabou/train/src/models/cnn_classifier.py | mmarouen/marabou | 2f3f7512714c94b8d8f3da12751895ea091fe5f6 | [
"MIT"
] | 2 | 2020-05-24T12:15:33.000Z | 2020-05-24T12:29:29.000Z | marabou/train/src/models/cnn_classifier.py | mmarouen/marabou | 2f3f7512714c94b8d8f3da12751895ea091fe5f6 | [
"MIT"
] | 11 | 2020-05-02T23:26:49.000Z | 2022-02-27T08:10:59.000Z | marabou/train/src/models/cnn_classifier.py | mmarouen/marabou | 2f3f7512714c94b8d8f3da12751895ea091fe5f6 | [
"MIT"
] | null | null | null | import os
import pickle
import re
import subprocess
import time
from itertools import compress
import numpy as np
from cv2 import cv2
from keras.applications.vgg16 import VGG16
from keras.models import Model, load_model
from keras.layers import Dense, Flatten, Dropout
from keras.utils import to_categorical
import panda... | 43.11747 | 117 | 0.617324 |
1c465512236dd5e487d4620bb11fe1ccf6b857ef | 631 | py | Python | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | 4 | 2016-02-21T12:40:44.000Z | 2019-06-13T13:23:19.000Z | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | null | null | null | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | 1 | 2020-07-16T12:22:12.000Z | 2020-07-16T12:22:12.000Z | import os.path
import pysoup.utils.assets
class Logger(object):
def __init__(self, cwd):
self._log = ''
self._cwd = cwd
def log(self, text):
self._log += '{0}\n'.format(text)
def log_dependency_results(self, failed_dependencies):
for dependency in failed_dependencies:
... | 27.434783 | 68 | 0.59588 |
2ebd7e224efda901f03494bb9963e5a47a5af332 | 561 | py | Python | tests/basics/special_comparisons.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/basics/special_comparisons.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/basics/special_comparisons.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | class A:
def __eq__(self, other):
print("A __eq__ called")
return True
class B:
def __ne__(self, other):
print("B __ne__ called")
return True
class C:
def __eq__(self, other):
print("C __eq__ called")
return False
class D:
def __ne__(self, other):
... | 16.5 | 36 | 0.509804 |
e424708f0e8028fb143635d432fbe1c539e2a2d0 | 3,697 | py | Python | jogo_da_velha.py | mateusmantoan/jogo_da_velha | 669917331373375857ad1d3e893400b5f125aaa3 | [
"CC0-1.0"
] | null | null | null | jogo_da_velha.py | mateusmantoan/jogo_da_velha | 669917331373375857ad1d3e893400b5f125aaa3 | [
"CC0-1.0"
] | null | null | null | jogo_da_velha.py | mateusmantoan/jogo_da_velha | 669917331373375857ad1d3e893400b5f125aaa3 | [
"CC0-1.0"
] | null | null | null | from os import system, name
from time import sleep
from random import sample
import random
def clear():
if name == 'nt':
_ = system('cls')
else:
_ = system('clear')
def print_table():
clear()
sleep(0.1)
if human == "X" or human == "O":
print("You chose", human, "\n")
p... | 27.589552 | 113 | 0.505004 |
fc90444551cff36d3a561885e3f79b96e9b73dc6 | 894 | py | Python | backend/website/squatofadt/urls.py | KiOui/squatofadt | 78ddd629c49a0d6043ddfb0e5609bfc5842d986e | [
"MIT"
] | null | null | null | backend/website/squatofadt/urls.py | KiOui/squatofadt | 78ddd629c49a0d6043ddfb0e5609bfc5842d986e | [
"MIT"
] | null | null | null | backend/website/squatofadt/urls.py | KiOui/squatofadt | 78ddd629c49a0d6043ddfb0e5609bfc5842d986e | [
"MIT"
] | null | null | null | """squatofadt URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 37.25 | 81 | 0.705817 |
a1c34d095e3b9efcc7b467d8dfb03da0abf26351 | 4,738 | py | Python | openmdao.util/src/openmdao/util/filexfer.py | OzanCKN/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | 1 | 2015-11-05T11:14:45.000Z | 2015-11-05T11:14:45.000Z | openmdao.util/src/openmdao/util/filexfer.py | janus/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | null | null | null | openmdao.util/src/openmdao/util/filexfer.py | janus/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | 1 | 2020-07-15T02:45:54.000Z | 2020-07-15T02:45:54.000Z | import fnmatch
import glob
import os
import sys
import zipfile
from openmdao.util.log import NullLogger
def filexfer(src_server, src_path, dst_server, dst_path, mode=''):
"""
Transfer a file from one place to another.
If `src_server` or `dst_server` is None, then the :mod:`os` module
is used for the... | 28.542169 | 79 | 0.573027 |
2a5111cb2c898391500c7f39a9d9cb2e85eeb07c | 1,163 | py | Python | courses/fields.py | SergePogorelov/educa | c3b23b22f94788099f5b607d98dac957287b3923 | [
"BSD-3-Clause"
] | null | null | null | courses/fields.py | SergePogorelov/educa | c3b23b22f94788099f5b607d98dac957287b3923 | [
"BSD-3-Clause"
] | 8 | 2021-03-19T11:28:02.000Z | 2022-03-12T00:48:58.000Z | courses/fields.py | SergePogorelov/educa | c3b23b22f94788099f5b607d98dac957287b3923 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.core.exceptions import ObjectDoesNotExist
class OrderField(models.PositiveIntegerField):
def __init__(self, for_fields=None, *args, **kwargs):
self.for_fields = for_fields
super(OrderField, self).__init__(*args, **kwargs)
def pre_save(self, model_inst... | 40.103448 | 95 | 0.590714 |
acf59ca7d715f91f4c8078da84321bce9e3f6771 | 7,350 | py | Python | manhuagui.py | q6806161/manhuagui | 42e278d73c234f2015823a4ef3dadeebdc596d56 | [
"MIT"
] | null | null | null | manhuagui.py | q6806161/manhuagui | 42e278d73c234f2015823a4ef3dadeebdc596d56 | [
"MIT"
] | null | null | null | manhuagui.py | q6806161/manhuagui | 42e278d73c234f2015823a4ef3dadeebdc596d56 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Author:Lvcong Chen
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
fro... | 40.384615 | 116 | 0.565306 |
e7dcb0448c7097d067edb298c3e52fb93d5e0fa5 | 15,178 | py | Python | torchgeo/datasets/benin_cashews.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | torchgeo/datasets/benin_cashews.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | torchgeo/datasets/benin_cashews.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Smallholder Cashew Plantations in Benin dataset."""
import json
import os
from functools import lru_cache
from typing import Callable, Dict, Optional, Tuple
import matplotlib.pyplot as plt
import numpy as np
import raste... | 30.97551 | 88 | 0.579787 |
98458209f4c94cabac7a6153419d6373f308f9fd | 13,417 | py | Python | api/views.py | noutrela/jaikuenginepatch | ab723e5480f36c471faa8bca4c65c2f7487f0365 | [
"Apache-2.0"
] | 1 | 2016-05-09T10:35:57.000Z | 2016-05-09T10:35:57.000Z | api/views.py | noutrela/jaikuenginepatch | ab723e5480f36c471faa8bca4c65c2f7487f0365 | [
"Apache-2.0"
] | null | null | null | api/views.py | noutrela/jaikuenginepatch | ab723e5480f36c471faa8bca4c65c2f7487f0365 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.815556 | 79 | 0.701945 |
51c64d0dc842d8684b66b99014ee7328a8661ff1 | 2,381 | py | Python | src/position/close.py | bbeale/v20-python-samples | 99af42ebe927d81ded08884d775c7aeffe2b6149 | [
"MIT"
] | 257 | 2016-11-03T16:41:01.000Z | 2022-03-31T03:07:39.000Z | src/position/close.py | bbeale/v20-python-samples | 99af42ebe927d81ded08884d775c7aeffe2b6149 | [
"MIT"
] | 19 | 2016-12-19T04:52:18.000Z | 2021-06-06T18:30:35.000Z | src/position/close.py | bbeale/v20-python-samples | 99af42ebe927d81ded08884d775c7aeffe2b6149 | [
"MIT"
] | 149 | 2016-11-19T14:53:59.000Z | 2022-03-18T20:38:27.000Z | #!/usr/bin/env python
import argparse
import common.config
import common.view
import common.args
from order.view import print_order_create_response_transactions
def main():
"""
Close an open Trade in an Account
"""
parser = argparse.ArgumentParser()
#
# Add the command line argument to pars... | 24.802083 | 76 | 0.589668 |
afbe20c818836adc5f843a79b2b9a95c32bdd04e | 3,350 | py | Python | education_math_homework_generator/gen_number_line.py | sourcery-ai-bot/education_math_homework_generator | e5545dcee4cca18f2480b88f9019bbff208202f6 | [
"MIT"
] | null | null | null | education_math_homework_generator/gen_number_line.py | sourcery-ai-bot/education_math_homework_generator | e5545dcee4cca18f2480b88f9019bbff208202f6 | [
"MIT"
] | null | null | null | education_math_homework_generator/gen_number_line.py | sourcery-ai-bot/education_math_homework_generator | e5545dcee4cca18f2480b88f9019bbff208202f6 | [
"MIT"
] | null | null | null | import argparse
from education_math_homework_generator.util import convert_latex_to_pdf
from education_math_homework_generator.util import remove_temporary_files
# Credits:
# example code for numberlines from stackexchange
# https://tex.stackexchange.com/questions/148252/help-drawing-a-very-simple-number-line-using-... | 43.506494 | 120 | 0.668358 |
945a9863cf38f8fd1f7de6f447f9e23dc2c34c0a | 8,424 | py | Python | tests/components/smhi/test_config_flow.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | tests/components/smhi/test_config_flow.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | tests/components/smhi/test_config_flow.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Tests for SMHI config flow."""
from unittest.mock import Mock, patch
from smhi.smhi_lib import Smhi as SmhiApi, SmhiForecastException
from openpeerpower.components.smhi import config_flow
from openpeerpower.const import CONF_LATITUDE, CONF_LONGITUDE
# pylint: disable=protected-access
async def test_openpeerpower... | 31.315985 | 88 | 0.668803 |
f5c2d0c2ae220d85ed56bf635e6ef93b7ba35fce | 15,634 | py | Python | neutron/tests/unit/agent/linux/test_tc_lib.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/agent/linux/test_tc_lib.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | neutron/tests/unit/agent/linux/test_tc_lib.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2016 OVH SAS
# 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... | 41.25066 | 78 | 0.634323 |
c53dcbf41c5e737532fc2e93ce562e0f35050f54 | 2,013 | py | Python | python/misc/table-html.py | bmaupin/graveyard | 71d52fe6589ce13dfe7433906d1aa50df48c9f94 | [
"MIT"
] | 1 | 2019-11-23T10:44:58.000Z | 2019-11-23T10:44:58.000Z | python/misc/table-html.py | bmaupin/graveyard | 71d52fe6589ce13dfe7433906d1aa50df48c9f94 | [
"MIT"
] | 8 | 2020-07-16T07:14:12.000Z | 2020-10-14T17:25:33.000Z | python/misc/table-html.py | bmaupin/graveyard | 71d52fe6589ce13dfe7433906d1aa50df48c9f94 | [
"MIT"
] | 1 | 2019-11-23T10:45:00.000Z | 2019-11-23T10:45:00.000Z | #!/usr/bin/env python
'''
Copyright (C) 2012 Bryan Maupin <bmaupincode@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later... | 25.807692 | 70 | 0.631396 |
a3a0f224f8b217e652d212f671acd8587a81c605 | 7,887 | py | Python | test/test_rivescript_coverage_plugin.py | snoopyjc/rivescript_coverage_plugin | dab9a36c0c48e040909c487cc7d96fe2b60ef267 | [
"MIT"
] | 1 | 2020-01-17T22:08:47.000Z | 2020-01-17T22:08:47.000Z | test/test_rivescript_coverage_plugin.py | snoopyjc/rivescript_coverage_plugin | dab9a36c0c48e040909c487cc7d96fe2b60ef267 | [
"MIT"
] | 18 | 2020-01-17T22:07:29.000Z | 2020-03-29T22:13:12.000Z | test/test_rivescript_coverage_plugin.py | snoopyjc/rivescript_coverage_plugin | dab9a36c0c48e040909c487cc7d96fe2b60ef267 | [
"MIT"
] | null | null | null | """
Tests for `rivescript_coverage_plugin` module.
"""
#from rivescript_coverage_plugin import rivescript_coverage_plugin
import rive
import pytest
from rivescript import RiveScript
import os
USER='user' # v1.0.0: Issue 14
USER2='user2' # v1.0.0: Issue 14
@pytest.fixture(scope="session", autouse=True)
... | 35.527027 | 134 | 0.605807 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.