hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7284c3b05332673bf46f3a853c15db048e94b4f | 1,589 | py | Python | webu/middleware/formatting.py | happyuc-project/webu.py | 5a01124fc84d74df09a33d9dabe88b704cd5b6c6 | [
"MIT"
] | null | null | null | webu/middleware/formatting.py | happyuc-project/webu.py | 5a01124fc84d74df09a33d9dabe88b704cd5b6c6 | [
"MIT"
] | null | null | null | webu/middleware/formatting.py | happyuc-project/webu.py | 5a01124fc84d74df09a33d9dabe88b704cd5b6c6 | [
"MIT"
] | null | null | null | from cytoolz.dicttoolz import (
assoc,
)
def construct_formatting_middleware(request_formatters=None,
result_formatters=None,
error_formatters=None):
if request_formatters is None:
request_formatters = {}
if result_formatters ... | 35.311111 | 68 | 0.546885 | from cytoolz.dicttoolz import (
assoc,
)
def construct_formatting_middleware(request_formatters=None,
result_formatters=None,
error_formatters=None):
if request_formatters is None:
request_formatters = {}
if result_formatters ... | true | true |
f7284d34e7332b7266ecb6fcdfa787da52f0bba3 | 2,050 | py | Python | api/control/getitem.py | savazeb/cosmos-ai | 4606e959396ebedca73086601078aa9c0ed77b31 | [
"MIT"
] | null | null | null | api/control/getitem.py | savazeb/cosmos-ai | 4606e959396ebedca73086601078aa9c0ed77b31 | [
"MIT"
] | null | null | null | api/control/getitem.py | savazeb/cosmos-ai | 4606e959396ebedca73086601078aa9c0ed77b31 | [
"MIT"
] | null | null | null | import json
import numpy as np
class stride():
def __init__(self, size = 1):
self.size = size
self.list = self.init_list()
def init_list(self):
return []
def add(self, value):
self.list.append(value)
if len(self.list) > self.size:
self.list = self.list[1:... | 26.623377 | 68 | 0.582927 | import json
import numpy as np
class stride():
def __init__(self, size = 1):
self.size = size
self.list = self.init_list()
def init_list(self):
return []
def add(self, value):
self.list.append(value)
if len(self.list) > self.size:
self.list = self.list[1:... | true | true |
f7284ee7f93f92b8e64bb9baabdaaf8617ec383d | 3,401 | py | Python | src/dispatch/models.py | vj-codes/dispatch | f9354781956380cac290be02fb987eb50ddc1a5d | [
"Apache-2.0"
] | null | null | null | src/dispatch/models.py | vj-codes/dispatch | f9354781956380cac290be02fb987eb50ddc1a5d | [
"Apache-2.0"
] | null | null | null | src/dispatch/models.py | vj-codes/dispatch | f9354781956380cac290be02fb987eb50ddc1a5d | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from typing import List, Optional
import validators
from pydantic import BaseModel, validator
from sqlalchemy import Boolean, Column, DateTime, Integer, String, event, ForeignKey
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
# SQLAlchemy mo... | 22.825503 | 84 | 0.699206 | from datetime import datetime
from typing import List, Optional
import validators
from pydantic import BaseModel, validator
from sqlalchemy import Boolean, Column, DateTime, Integer, String, event, ForeignKey
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
class ProjectM... | true | true |
f7284ff02950f77f56cfd81b481051562718552f | 4,423 | py | Python | bioconda_utils/graph.py | alshai/bioconda-utils | 68bbf927ac1996d5c93a5583ed0bbe9d7eacc821 | [
"MIT"
] | 90 | 2016-07-16T02:52:15.000Z | 2022-03-17T06:09:41.000Z | bioconda_utils/graph.py | alshai/bioconda-utils | 68bbf927ac1996d5c93a5583ed0bbe9d7eacc821 | [
"MIT"
] | 550 | 2016-05-29T16:07:13.000Z | 2022-03-25T00:06:47.000Z | bioconda_utils/graph.py | alshai/bioconda-utils | 68bbf927ac1996d5c93a5583ed0bbe9d7eacc821 | [
"MIT"
] | 113 | 2016-09-04T22:02:33.000Z | 2022-03-30T20:00:32.000Z | """
Construction and Manipulation of Package/Recipe Graphs
"""
import logging
from collections import defaultdict
from fnmatch import fnmatch
from itertools import chain
import networkx as nx
from . import utils
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
def build(recipes, config, black... | 29.885135 | 93 | 0.625141 |
import logging
from collections import defaultdict
from fnmatch import fnmatch
from itertools import chain
import networkx as nx
from . import utils
logger = logging.getLogger(__name__)
def build(recipes, config, blacklist=None, restrict=True):
logger.info("Generating DAG")
recipes = list(recipes)
... | true | true |
f72850f949715caa7282e6ca85f148a75ebc1074 | 12,807 | py | Python | python/paddle/fluid/tests/unittests/test_dist_fleet_base.py | donproc/Paddle | 23261ff44ba46a507e72e2da7c83f7fede3486f7 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_dist_fleet_base.py | donproc/Paddle | 23261ff44ba46a507e72e2da7c83f7fede3486f7 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_dist_fleet_base.py | donproc/Paddle | 23261ff44ba46a507e72e2da7c83f7fede3486f7 | [
"Apache-2.0"
] | null | null | null | # 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... | 36.591429 | 191 | 0.612165 |
from __future__ import print_function
import os
import sys
import subprocess
import six
import shutil
import numpy as np
import argparse
from contextlib import closing
import socket
import time
import tempfile
import unittest
import paddle.fluid as fluid
import paddle.distributed.fleet.base.role_maker ... | true | true |
f72850feefd4a690b228282eb0040c8340c2bdc4 | 2,251 | py | Python | source/flask_api.py | PhoxSpark/pytom2 | 2ef46342d5fc0e98e6d059c86538035d6c758636 | [
"Apache-2.0"
] | null | null | null | source/flask_api.py | PhoxSpark/pytom2 | 2ef46342d5fc0e98e6d059c86538035d6c758636 | [
"Apache-2.0"
] | null | null | null | source/flask_api.py | PhoxSpark/pytom2 | 2ef46342d5fc0e98e6d059c86538035d6c758636 | [
"Apache-2.0"
] | null | null | null | """
Flask API main module.
"""
from __future__ import absolute_import
import logging
from flask import Flask
from flask_restplus import Api, Resource, fields
from pytom2.source.pdb_parser_module import PDB
logging.info("Initializing Flask objects...")
APP = Flask(__name__)
API = Api(APP)
logging.info("In... | 30.835616 | 103 | 0.569525 | from __future__ import absolute_import
import logging
from flask import Flask
from flask_restplus import Api, Resource, fields
from pytom2.source.pdb_parser_module import PDB
logging.info("Initializing Flask objects...")
APP = Flask(__name__)
API = Api(APP)
logging.info("Initializing model for organism and ... | true | true |
f728511fd3fc7b6b2fc4e8991b41ddb947757f32 | 12,464 | py | Python | Bio/Prosite/Prodoc.py | eoc21/biopython | c0f8db8f55a506837c320459957a0ce99b0618b6 | [
"PostgreSQL"
] | 3 | 2017-10-23T21:53:57.000Z | 2019-09-23T05:14:12.000Z | Bio/Prosite/Prodoc.py | eoc21/biopython | c0f8db8f55a506837c320459957a0ce99b0618b6 | [
"PostgreSQL"
] | null | null | null | Bio/Prosite/Prodoc.py | eoc21/biopython | c0f8db8f55a506837c320459957a0ce99b0618b6 | [
"PostgreSQL"
] | null | null | null | # Copyright 2000 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
This module is OBSOLETE.
Most of the functionality in this module has moved to Bio.ExPASy.... | 32.543081 | 284 | 0.618983 |
"""
This module is OBSOLETE.
Most of the functionality in this module has moved to Bio.ExPASy.Prodoc;
please see
Bio.ExPASy.Prodoc.read To read a Prodoc file containing one entry.
Bio.ExPASy.Prodoc.parse Iterates over entries in a Prodoc file.
Bio.ExPASy.Prodoc.Record Holds Prodoc data.
Bi... | false | true |
f72851af1ca5aeba4f4a0a24a60e1fb3cad1b327 | 5,204 | py | Python | Sprint3 Creating Redshift Cluster.py | Jeremy-Tian/Data-Lake | 62d2aad31e924ffc536cca98001da7671a7a9fde | [
"MIT"
] | null | null | null | Sprint3 Creating Redshift Cluster.py | Jeremy-Tian/Data-Lake | 62d2aad31e924ffc536cca98001da7671a7a9fde | [
"MIT"
] | null | null | null | Sprint3 Creating Redshift Cluster.py | Jeremy-Tian/Data-Lake | 62d2aad31e924ffc536cca98001da7671a7a9fde | [
"MIT"
] | null | null | null |
import pandas as pd
import boto3
import json
import configparser
config = configparser.ConfigParser()
config.read_file(open('dwh.cfg'))
KEY = config.get('AWS','KEY')
SECRET = config.get('AWS','SECRET')
DWH_CLUSTER_TYPE = config.get("DWH","DWH_CLUSTER_TYPE")
DWH_NUM_NODES ... | 27.246073 | 176 | 0.62548 |
import pandas as pd
import boto3
import json
import configparser
config = configparser.ConfigParser()
config.read_file(open('dwh.cfg'))
KEY = config.get('AWS','KEY')
SECRET = config.get('AWS','SECRET')
DWH_CLUSTER_TYPE = config.get("DWH","DWH_CLUSTER_TYPE")
DWH_NUM_NODES ... | true | true |
f7285218ec2efc269a29428d46bab2143b47e537 | 1,737 | py | Python | AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_abstract_numbers.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_abstract_numbers.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_abstract_numbers.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | """Unit tests for numbers.py."""
import math
import unittest
from numbers import Complex, Real, Rational, Integral
from test import test_support
class TestNumbers(unittest.TestCase):
def test_int(self):
self.assertTrue(issubclass(int, Integral))
self.assertTrue(issubclass(int, Complex))
... | 32.773585 | 71 | 0.64076 |
import math
import unittest
from numbers import Complex, Real, Rational, Integral
from test import test_support
class TestNumbers(unittest.TestCase):
def test_int(self):
self.assertTrue(issubclass(int, Integral))
self.assertTrue(issubclass(int, Complex))
self.assertEqual(7, int... | true | true |
f7285294d2a931523127fa75c792a0d89962c046 | 26 | py | Python | tiktok.py | yalinsili/dsadasdas | 9431370fae53a1fd0d9de9c4c6964c071c7c24a1 | [
"Apache-2.0"
] | null | null | null | tiktok.py | yalinsili/dsadasdas | 9431370fae53a1fd0d9de9c4c6964c071c7c24a1 | [
"Apache-2.0"
] | null | null | null | tiktok.py | yalinsili/dsadasdas | 9431370fae53a1fd0d9de9c4c6964c071c7c24a1 | [
"Apache-2.0"
] | null | null | null | while 1==1:
import bot | 13 | 14 | 0.615385 | while 1==1:
import bot | true | true |
f72852a942e1a5b7682e55b1b0f064fb0bffdf7a | 2,640 | py | Python | libqtile/widget/windowname.py | dequis/qtile | 560e7230016acf4ca47c7c539bb65479085e2019 | [
"MIT"
] | null | null | null | libqtile/widget/windowname.py | dequis/qtile | 560e7230016acf4ca47c7c539bb65479085e2019 | [
"MIT"
] | null | null | null | libqtile/widget/windowname.py | dequis/qtile | 560e7230016acf4ca47c7c539bb65479085e2019 | [
"MIT"
] | null | null | null | # Copyright (c) 2008, 2010 Aldo Cortesi
# Copyright (c) 2010 matt
# Copyright (c) 2011 Mounier Florian
# Copyright (c) 2012 Tim Neumann
# Copyright (c) 2013 Craig Barnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Tycho Andersen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# o... | 40 | 79 | 0.680682 |
from .. import hook, bar
from . import base
class WindowName(base._TextBox):
orientations = base.ORIENTATION_HORIZONTAL
defaults = [
('show_state', True, 'show window status before window name')
]
def __init__(self, width=bar.STRETCH, **config):
base._TextBox... | true | true |
f72852f4ac13fca51ab80c2736e7db2768c0638d | 3,004 | py | Python | packages/dinesti/python/_time.py | USEPA/Water-Security-Toolkit | 6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb | [
"BSD-3-Clause"
] | 3 | 2019-06-10T18:04:14.000Z | 2020-12-05T18:11:40.000Z | packages/dinesti/python/_time.py | USEPA/Water-Security-Toolkit | 6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb | [
"BSD-3-Clause"
] | null | null | null | packages/dinesti/python/_time.py | USEPA/Water-Security-Toolkit | 6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb | [
"BSD-3-Clause"
] | 2 | 2020-09-24T19:04:14.000Z | 2020-12-05T18:11:43.000Z | # Copyright (2013) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
# retains certain rights in this software.
#
# This software is released under the FreeBSD license as described
# in License.txt
import time as Timer
import datetime
import string
impor... | 3,004 | 3,004 | 0.688748 | false | true | |
f72853030445b587ffb032857bffca4fd08ac3e8 | 335 | py | Python | invenio_subjects_lcsh/__init__.py | fenekku/invenio-subjects-lcsh | e6070b6c4cbedc3ade7a06d5dcb9ba039a2ed3ae | [
"MIT"
] | null | null | null | invenio_subjects_lcsh/__init__.py | fenekku/invenio-subjects-lcsh | e6070b6c4cbedc3ade7a06d5dcb9ba039a2ed3ae | [
"MIT"
] | null | null | null | invenio_subjects_lcsh/__init__.py | fenekku/invenio-subjects-lcsh | e6070b6c4cbedc3ade7a06d5dcb9ba039a2ed3ae | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Northwestern University.
#
# invenio-subjects-lcsh is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""MeSH subject terms for InvenioRDM."""
from .version import __version__
__all__ = (... | 23.928571 | 73 | 0.725373 |
from .version import __version__
__all__ = ('__version__')
| true | true |
f72853cad0f83808389d02847ac165bae9c66050 | 21,066 | py | Python | autokeras/task.py | parthpatwa/autokeras | 2b23d870e91afdd2bc12663ff6e00e9df9ef855c | [
"MIT"
] | 1 | 2019-10-28T13:44:11.000Z | 2019-10-28T13:44:11.000Z | autokeras/task.py | parthpatwa/autokeras | 2b23d870e91afdd2bc12663ff6e00e9df9ef855c | [
"MIT"
] | null | null | null | autokeras/task.py | parthpatwa/autokeras | 2b23d870e91afdd2bc12663ff6e00e9df9ef855c | [
"MIT"
] | null | null | null | import pandas as pd
from autokeras import auto_model
from autokeras.hypermodel import head
from autokeras.hypermodel import node
class SupervisedImagePipeline(auto_model.AutoModel):
def __init__(self, outputs, **kwargs):
super().__init__(inputs=node.ImageInput(),
outputs=outputs... | 44.821277 | 85 | 0.580651 | import pandas as pd
from autokeras import auto_model
from autokeras.hypermodel import head
from autokeras.hypermodel import node
class SupervisedImagePipeline(auto_model.AutoModel):
def __init__(self, outputs, **kwargs):
super().__init__(inputs=node.ImageInput(),
outputs=outputs... | true | true |
f72853fef919de8ffd86762057a90fb3082a1d2d | 56 | py | Python | nempy/__init__.py | bje-/nempy | 3a3c30d6e7aa203e1f09cdd826e65967ad214a2c | [
"BSD-3-Clause"
] | null | null | null | nempy/__init__.py | bje-/nempy | 3a3c30d6e7aa203e1f09cdd826e65967ad214a2c | [
"BSD-3-Clause"
] | null | null | null | nempy/__init__.py | bje-/nempy | 3a3c30d6e7aa203e1f09cdd826e65967ad214a2c | [
"BSD-3-Clause"
] | null | null | null | from nempy import markets, historical_spot_market_inputs | 56 | 56 | 0.910714 | from nempy import markets, historical_spot_market_inputs | true | true |
f72854cf53d8f8b51f8d99a44f125330be2d13af | 1,069 | py | Python | atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-09-13T08:56:49.000Z | 2021-01-10T11:21:34.000Z | atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-10-15T19:39:58.000Z | 2020-10-15T19:41:03.000Z | atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-02-29T15:42:22.000Z | 2018-05-08T08:58:18.000Z | from os.path import abspath, dirname, join
from fnmatch import fnmatchcase
from operator import eq
from robot.api import logger
CURDIR = dirname(abspath(__file__))
def output_should_be(actual, expected, **replaced):
actual = _read_file(actual, 'Actual')
expected = _read_file(join(CURDIR, expected), 'Expect... | 33.40625 | 76 | 0.627689 | from os.path import abspath, dirname, join
from fnmatch import fnmatchcase
from operator import eq
from robot.api import logger
CURDIR = dirname(abspath(__file__))
def output_should_be(actual, expected, **replaced):
actual = _read_file(actual, 'Actual')
expected = _read_file(join(CURDIR, expected), 'Expect... | true | true |
f72858863e51544c1e5bb7067e1e7750dccf22c1 | 18,799 | py | Python | tensorflow/python/debug/wrappers/framework.py | bhbai/tensorflow | d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3 | [
"Apache-2.0"
] | 13 | 2017-01-17T07:48:00.000Z | 2022-03-09T09:43:59.000Z | tensorflow/python/debug/wrappers/framework.py | bhbai/tensorflow | d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3 | [
"Apache-2.0"
] | 1 | 2017-02-06T08:12:22.000Z | 2017-02-06T08:12:22.000Z | tensorflow/python/debug/wrappers/framework.py | bhbai/tensorflow | d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3 | [
"Apache-2.0"
] | 3 | 2017-05-12T03:45:56.000Z | 2018-02-26T04:33:28.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.20412 | 80 | 0.712432 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session
from tensorflow.python.debug import debug_utils
from tensorflow.python.debug import steppe... | true | true |
f72858c49321fde71f3ef219f0128d6912bc3126 | 129 | py | Python | yapup/pandas/__init__.py | klaukh/yapup | 34f62834b19d88ee610aea6c02ec346b2080d04d | [
"MIT"
] | null | null | null | yapup/pandas/__init__.py | klaukh/yapup | 34f62834b19d88ee610aea6c02ec346b2080d04d | [
"MIT"
] | null | null | null | yapup/pandas/__init__.py | klaukh/yapup | 34f62834b19d88ee610aea6c02ec346b2080d04d | [
"MIT"
] | null | null | null | # Import from individual files
from .dataframe import *
# Remove dunders
__all__ = [f for f in dir() if not f.startswith("_")]
| 18.428571 | 53 | 0.705426 |
from .dataframe import *
__all__ = [f for f in dir() if not f.startswith("_")]
| true | true |
f7285a490579fe0f79fba70d510af3f92a71a705 | 303 | py | Python | data/multilingual/Latn.SMO/Serif_8/pdf_to_json_test_Latn.SMO_Serif_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.SMO/Serif_8/pdf_to_json_test_Latn.SMO_Serif_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.SMO/Serif_8/pdf_to_json_test_Latn.SMO_Serif_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.SMO/Serif_8/udhr_Latn.SMO_Serif_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 30.3 | 73 | 0.811881 | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.SMO/Serif_8/udhr_Latn.SMO_Serif_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| true | true |
f7285aaeae66b1000e66ccd2a5c5ab2b62c03c0a | 118 | py | Python | accounts/views/account_views.py | Onlynfk/Freshdesk-CRM-Platform | 67137af09f7daf6fa2d19a9e70d573548137c9db | [
"MIT"
] | null | null | null | accounts/views/account_views.py | Onlynfk/Freshdesk-CRM-Platform | 67137af09f7daf6fa2d19a9e70d573548137c9db | [
"MIT"
] | null | null | null | accounts/views/account_views.py | Onlynfk/Freshdesk-CRM-Platform | 67137af09f7daf6fa2d19a9e70d573548137c9db | [
"MIT"
] | null | null | null | from django.shortcuts import render
def accounts(request):
return render(request, 'accounts/account.html')
| 19.666667 | 52 | 0.737288 | from django.shortcuts import render
def accounts(request):
return render(request, 'accounts/account.html')
| true | true |
f7285bf51531130a3c1e178a459430b0ee8380fb | 138 | py | Python | src/trafficSimulator/point.py | Naor-Yekutiely/trafficSimulator | 54e8b9a66c7bcaff24fd119a0e693187591db8a1 | [
"MIT"
] | 1 | 2021-12-06T17:17:06.000Z | 2021-12-06T17:17:06.000Z | src/trafficSimulator/point.py | Naor-Yekutiely/trafficSimulator | 54e8b9a66c7bcaff24fd119a0e693187591db8a1 | [
"MIT"
] | null | null | null | src/trafficSimulator/point.py | Naor-Yekutiely/trafficSimulator | 54e8b9a66c7bcaff24fd119a0e693187591db8a1 | [
"MIT"
] | null | null | null | class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def getPoint(self):
return (self.x, self.y)
| 17.25 | 31 | 0.507246 | class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def getPoint(self):
return (self.x, self.y)
| true | true |
f7285c026a4050700d4433328f0f70fd7238a0ed | 2,124 | py | Python | AlexaSongBot/modules/song.py | amegh-amz/AlexaSongBot | 593b288b5c2ac10c499597c0fb3234aae3a404db | [
"MIT"
] | 2 | 2021-03-22T09:33:03.000Z | 2021-03-23T13:30:20.000Z | AlexaSongBot/modules/song.py | amegh-amz/AlexaSongBot | 593b288b5c2ac10c499597c0fb3234aae3a404db | [
"MIT"
] | null | null | null | AlexaSongBot/modules/song.py | amegh-amz/AlexaSongBot | 593b288b5c2ac10c499597c0fb3234aae3a404db | [
"MIT"
] | 6 | 2021-03-22T11:56:43.000Z | 2022-02-18T15:46:20.000Z | from pyrogram import Client, filters
import asyncio
import os
from pytube import YouTube
from pyrogram.types import InlineKeyboardMarkup
from pyrogram.types import InlineKeyboardButton
from youtubesearchpython import VideosSearch
from AlexaSongBot.mrdarkprince import ignore_blacklisted_users, get_arg
from AlexaSongBot ... | 34.819672 | 115 | 0.665254 | from pyrogram import Client, filters
import asyncio
import os
from pytube import YouTube
from pyrogram.types import InlineKeyboardMarkup
from pyrogram.types import InlineKeyboardButton
from youtubesearchpython import VideosSearch
from AlexaSongBot.mrdarkprince import ignore_blacklisted_users, get_arg
from AlexaSongBot ... | true | true |
f7285c8cc5a851eaea8d9ca6598fc0794283e7ff | 4,627 | py | Python | homeassistant/components/gios/air_quality.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 5 | 2020-09-17T10:48:51.000Z | 2021-11-22T00:08:17.000Z | homeassistant/components/gios/air_quality.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/components/gios/air_quality.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 6 | 2019-12-01T19:06:52.000Z | 2020-09-17T00:57:06.000Z | """Support for the GIOS service."""
from homeassistant.components.air_quality import (
ATTR_CO,
ATTR_NO2,
ATTR_OZONE,
ATTR_PM_2_5,
ATTR_PM_10,
ATTR_SO2,
AirQualityEntity,
)
from homeassistant.const import CONF_NAME
from .const import ATTR_STATION, DATA_CLIENT, DEFAULT_SCAN_INTERVAL, DOMAIN,... | 29.100629 | 88 | 0.592392 | from homeassistant.components.air_quality import (
ATTR_CO,
ATTR_NO2,
ATTR_OZONE,
ATTR_PM_2_5,
ATTR_PM_10,
ATTR_SO2,
AirQualityEntity,
)
from homeassistant.const import CONF_NAME
from .const import ATTR_STATION, DATA_CLIENT, DEFAULT_SCAN_INTERVAL, DOMAIN, ICONS_MAP
ATTRIBUTION = "Data prov... | true | true |
f7285d209d8dec2abc3f07b89c6b4a0108cd21a6 | 2,076 | py | Python | Exercise_7_problem_1.py | student-work-agu-gis2021/lesson7-matplotlib-AbeRyusei | 2adc657c1c1c02014a5a113b25f28756df377619 | [
"BSD-3-Clause"
] | null | null | null | Exercise_7_problem_1.py | student-work-agu-gis2021/lesson7-matplotlib-AbeRyusei | 2adc657c1c1c02014a5a113b25f28756df377619 | [
"BSD-3-Clause"
] | null | null | null | Exercise_7_problem_1.py | student-work-agu-gis2021/lesson7-matplotlib-AbeRyusei | 2adc657c1c1c02014a5a113b25f28756df377619 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# ## Problem 1: Simple scatter plot using random
#
# We can generate random numbers using using a method `random.rand()` from the [NumPy package](https://numpy.org/). This example generates 10 random values:
#
# ```
# import numpy as np
# random_numbers = np.random.rand(10)
#
... | 24.139535 | 165 | 0.691233 |
rame()
data["x"] = x
data["y"] = y
print(data.head())
assert len(data) == 1000, "There should be 1000 rows of data."
(1000)
print(colors[0:10])
assert len(colors) == 1000, "There should be 1000 random numbers for colors"
el("X-label")
plt.ylabel("Y-label")
plt.show()
outputfp = "my_first_plot.png"
pri... | true | true |
f7285d241ce75e9b15cd66033dc57a73fcf965fe | 3,158 | py | Python | data/p2DJ/New/program/qiskit/class/startQiskit_Class182.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/class/startQiskit_Class182.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/class/startQiskit_Class182.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=13
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... | 28.196429 | 80 | 0.618746 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def b... | true | true |
f7285d2b964cb3217a49516ff0bbcdfaab4c6562 | 1,154 | py | Python | src/LA_Apartment_Analysis.py | mann-brinson/LA_Apartments_Scraper | ba87e85d3539a8d91ce0a84d8f4e7616757472f2 | [
"CC0-1.0"
] | 2 | 2020-01-13T21:13:50.000Z | 2021-05-31T14:44:31.000Z | src/LA_Apartment_Analysis.py | mann-brinson/LA_Apartments_Scraper | ba87e85d3539a8d91ce0a84d8f4e7616757472f2 | [
"CC0-1.0"
] | 1 | 2021-06-02T00:52:22.000Z | 2021-06-02T00:52:22.000Z | src/LA_Apartment_Analysis.py | mann-brinson/LA_Apartments_Scraper | ba87e85d3539a8d91ce0a84d8f4e7616757472f2 | [
"CC0-1.0"
] | null | null | null | import neighborhoods_api
import apartments_scrape
import queries_from_terminal
import sys
print(f"We're in file {__file__}")
#Require the user to input this driver and source option
#Will prompt the user to enter a source argument (remote or local)
if len(sys.argv) < 2:
print('To few arguments, please put in LA_A... | 39.793103 | 151 | 0.768631 | import neighborhoods_api
import apartments_scrape
import queries_from_terminal
import sys
print(f"We're in file {__file__}")
#Require the user to input this driver and source option
#Will prompt the user to enter a source argument (remote or local)
if len(sys.argv) < 2:
print('To few arguments, please put in LA_A... | true | true |
f7285eae36778f3c3540ee760f0731e31def83ac | 52,140 | py | Python | appengine/components/components/auth/api_test.py | amymariaparker2401/luci-py | c5902547adc12390df6b09c825a38370f1034e8b | [
"Apache-2.0"
] | null | null | null | appengine/components/components/auth/api_test.py | amymariaparker2401/luci-py | c5902547adc12390df6b09c825a38370f1034e8b | [
"Apache-2.0"
] | 1 | 2022-03-02T09:56:27.000Z | 2022-03-02T09:56:27.000Z | appengine/components/components/auth/api_test.py | Lees78/luci-py | 7b854c55f63e648005ae8aa38e2e41cd8f99feda | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
# Disable 'Access to a protected member', Unused argument', 'Unused variable'.
# pylint: disable=W0212,W0612,W0613
# pylint... | 35.736806 | 80 | 0.658113 |
# pylint: disable=W0212,W0612,W0613
# pylint: disable=redefined-outer-name
import datetime
import sys
import threading
import unittest
from six.moves import queue
import mock
from test_support import test_env
test_env.setup_test_env()
from google.appengine.ext import ndb
from components.auth import api
from ... | true | true |
f7285ecfd2ae9a77128a046f84d7aa4562c2c9af | 396 | py | Python | purnkleen/wsgi.py | RommelTJ/purnkleen | 7a2c94fa0c2331cdc2f72e4d6718068bf00357c4 | [
"MIT"
] | 1 | 2017-12-22T04:48:22.000Z | 2017-12-22T04:48:22.000Z | purnkleen/wsgi.py | RommelTJ/purnkleen | 7a2c94fa0c2331cdc2f72e4d6718068bf00357c4 | [
"MIT"
] | 27 | 2018-03-05T16:21:52.000Z | 2021-03-09T04:41:16.000Z | purnkleen/wsgi.py | RommelTJ/purnkleen | 7a2c94fa0c2331cdc2f72e4d6718068bf00357c4 | [
"MIT"
] | null | null | null | """
WSGI config for purnkleen project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | 23.294118 | 78 | 0.787879 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "purnkleen.settings")
application = get_wsgi_application()
| true | true |
f728607832ca55dae9a6e03f02e7c6d5ba6ef455 | 1,098 | py | Python | 1-python/python/data-types.py | Domin-Imperial/Domin-Respository | 2e531aabc113ed3511f349107695847b5c4e4320 | [
"MIT"
] | null | null | null | 1-python/python/data-types.py | Domin-Imperial/Domin-Respository | 2e531aabc113ed3511f349107695847b5c4e4320 | [
"MIT"
] | null | null | null | 1-python/python/data-types.py | Domin-Imperial/Domin-Respository | 2e531aabc113ed3511f349107695847b5c4e4320 | [
"MIT"
] | 1 | 2021-05-24T20:09:38.000Z | 2021-05-24T20:09:38.000Z | # python has several data types
# numeric data types -
# int, float
# int for whole numbers
x = 10 + 2
# python is dynamically typed, so we can assign whatever value we want to
# any variable... but type annotations are a good way to keep organized.
# float for fractional numbers or very large numbers
y: float = 10.... | 21.529412 | 74 | 0.680328 |
x = 10 + 2
y: float = 10.5
print(5 // 2)
print(5 / 2)
print(3 < 4 or 5 < 4)
data = "asdf"
data = 'asdf'
data = data[0]
print(data)
longstring = '''
multiline
string
'''
print('abc' in 'abcdef')
data2 = [ 3, 2, 6, 5 ]
print(data2[1])
| true | true |
f72860c96ea3e4d3445af521dd59c24b214a53e7 | 2,032 | py | Python | HouseMarketTracker/parser/HouseHomePageParser.py | SuperFireFoxy/HouseMarketTracker | b173bec5ff1c9b056231f5bae32ff59424f4bae3 | [
"MIT"
] | null | null | null | HouseMarketTracker/parser/HouseHomePageParser.py | SuperFireFoxy/HouseMarketTracker | b173bec5ff1c9b056231f5bae32ff59424f4bae3 | [
"MIT"
] | 6 | 2018-05-15T09:36:17.000Z | 2018-05-20T07:07:40.000Z | HouseMarketTracker/parser/HouseHomePageParser.py | SuperFireFoxy/HouseMarketTracker | b173bec5ff1c9b056231f5bae32ff59424f4bae3 | [
"MIT"
] | null | null | null | import re
from HouseMarketTracker.parser.ImagesParser import ImagesParser
from HouseMarketTracker.parser.ParseUtil import ParseUtil
class HouseHomePageParser():
def parse(self, response):
meta = response.meta
item = meta['item']
item['house_layout'] = self.parse_layout(response)
... | 40.64 | 118 | 0.609252 | import re
from HouseMarketTracker.parser.ImagesParser import ImagesParser
from HouseMarketTracker.parser.ParseUtil import ParseUtil
class HouseHomePageParser():
def parse(self, response):
meta = response.meta
item = meta['item']
item['house_layout'] = self.parse_layout(response)
... | true | true |
f728622e2085bc58fb4e845221f472ee9780896d | 6,229 | py | Python | pybind/slxos/v17r_2_00/system_config/interface/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_2_00/system_config/interface/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_2_00/system_config/interface/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 50.642276 | 525 | 0.728046 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f728637d14058244193eaac66b95488429463bb6 | 1,266 | py | Python | app/api/v1/models/user_models.py | Deekerubo/Store-Manager-API | 02ed2ce0c82d6854cc531a33a85bf9b8dff007fa | [
"MIT"
] | null | null | null | app/api/v1/models/user_models.py | Deekerubo/Store-Manager-API | 02ed2ce0c82d6854cc531a33a85bf9b8dff007fa | [
"MIT"
] | 2 | 2018-12-10T12:03:16.000Z | 2019-10-21T16:53:02.000Z | app/api/v1/models/user_models.py | Deekerubo/Store-Manager-API | 02ed2ce0c82d6854cc531a33a85bf9b8dff007fa | [
"MIT"
] | null | null | null |
from flask_restful import Resource, reqparse
from flask import Flask,request, make_response
from passlib.hash import pbkdf2_sha256 as sha256
users_list = []
class User():
def __init__(self, email, password):
self.user_id = len(users_list)+1
self.email = email
self.password = password
... | 28.133333 | 84 | 0.611374 |
from flask_restful import Resource, reqparse
from flask import Flask,request, make_response
from passlib.hash import pbkdf2_sha256 as sha256
users_list = []
class User():
def __init__(self, email, password):
self.user_id = len(users_list)+1
self.email = email
self.password = password
... | true | true |
f72863c4b8fbd54a1962f10f47b2584a72ee40bc | 11,725 | py | Python | services/PacketSniffer/PacketSniffer.py | ctgriffiths/twister | b3930549551b0104738d56f402eb9b4b90dd692c | [
"Apache-2.0"
] | 19 | 2015-01-29T11:02:42.000Z | 2021-06-03T11:45:42.000Z | services/PacketSniffer/PacketSniffer.py | ctgriffiths/twister | b3930549551b0104738d56f402eb9b4b90dd692c | [
"Apache-2.0"
] | 47 | 2015-01-02T11:39:39.000Z | 2022-02-05T11:29:07.000Z | services/PacketSniffer/PacketSniffer.py | ctgriffiths/twister | b3930549551b0104738d56f402eb9b4b90dd692c | [
"Apache-2.0"
] | 10 | 2015-01-12T07:24:39.000Z | 2017-11-05T00:17:30.000Z | #!/usr/bin/env python
# version: 3.001
#
# -*- coding: utf-8 -*-
#
# File: PacketSniffer.py ; This file is part of Twister.
#
# Copyright (C) 2012-2013 , Luxoft
#
# Authors:
# Adrian Toader <adtoader@luxoft.com>
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except... | 23.080709 | 97 | 0.655011 |
from binascii import b2a_base64
from rpyc import Service as rpycService
from rpyc import connect as rpycConnect
from rpyc.utils.helpers import BgServingThread as rpycBgServingThread
from uuid import uuid4
from time import sleep
from copy import deepcopy
from thread import allocate_lock
from... | true | true |
f72863ca7b1b865d798b9801a38bbfb1be6fdca9 | 33 | py | Python | src/estimate/__init__.py | haoyio/stock-opt | 4a7dc730693517fd25ddd5c105361f73b51f11ac | [
"Apache-2.0"
] | null | null | null | src/estimate/__init__.py | haoyio/stock-opt | 4a7dc730693517fd25ddd5c105361f73b51f11ac | [
"Apache-2.0"
] | null | null | null | src/estimate/__init__.py | haoyio/stock-opt | 4a7dc730693517fd25ddd5c105361f73b51f11ac | [
"Apache-2.0"
] | null | null | null | from estimate.constants import *
| 16.5 | 32 | 0.818182 | from estimate.constants import *
| true | true |
f72863e3fb5fd6105a714482bf8ca2e56058339c | 2,328 | py | Python | PyUtilities/OneDConsolidation.py | MingAtUWA/SimpleMPM2 | 7a1d7c257c621123d85a0630e93d42ae25c70fb4 | [
"MIT"
] | null | null | null | PyUtilities/OneDConsolidation.py | MingAtUWA/SimpleMPM2 | 7a1d7c257c621123d85a0630e93d42ae25c70fb4 | [
"MIT"
] | 2 | 2020-10-19T02:03:11.000Z | 2021-03-19T16:34:39.000Z | PyUtilities/OneDConsolidation.py | MingAtUWA/SimpleMPM2 | 7a1d7c257c621123d85a0630e93d42ae25c70fb4 | [
"MIT"
] | 1 | 2020-04-28T00:33:14.000Z | 2020-04-28T00:33:14.000Z | import math
import numpy as np
import matplotlib.pyplot as plt
class OneDConsolidation:
"""
z = 0, free flow boundary condition
z = H, impermeable boundary condition
Parameters:
1. Cv, coefficient of consolidation;
2. Es, one dimensional compressive modulus
3. u0, initial pore p... | 27.388235 | 66 | 0.514605 | import math
import numpy as np
import matplotlib.pyplot as plt
class OneDConsolidation:
def __init__(self, Cv, Es, u0, H, error_ratio = 1.0e-3):
self.Cv = Cv
self.Es = Es
self.u0 = u0
self.H = H
self.dH_final = -H * u0 / Es
self.error_ratio = error_ratio
... | true | true |
f7286403498a555edb43f7ec2a30c712369a4942 | 2,522 | py | Python | cinder/cmd/volume.py | yanheven/cinder | 89797971f30d547acbf715fea099c52d90966d1f | [
"Apache-2.0"
] | null | null | null | cinder/cmd/volume.py | yanheven/cinder | 89797971f30d547acbf715fea099c52d90966d1f | [
"Apache-2.0"
] | null | null | null | cinder/cmd/volume.py | yanheven/cinder | 89797971f30d547acbf715fea099c52d90966d1f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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. ... | 32.333333 | 78 | 0.697859 |
import os
import eventlet
from cinder import objects
if os.name == 'nt':
eventlet.monkey_patch(os=False)
else:
eventlet.monkey_patch()
import sys
import warnings
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
f... | true | true |
f728642f57feb750b04c0e857b4ecb83e8475772 | 1,299 | py | Python | src/named_entity_recognition/api_ner/google_api_repository.py | brunnurs/proton | 057889e2bcefd2e7e6bc3b0fcdf418a2123767a0 | [
"Apache-2.0"
] | null | null | null | src/named_entity_recognition/api_ner/google_api_repository.py | brunnurs/proton | 057889e2bcefd2e7e6bc3b0fcdf418a2123767a0 | [
"Apache-2.0"
] | null | null | null | src/named_entity_recognition/api_ner/google_api_repository.py | brunnurs/proton | 057889e2bcefd2e7e6bc3b0fcdf418a2123767a0 | [
"Apache-2.0"
] | null | null | null | import requests
import json
import requests
def remote_named_entity_recognition(document, ner_api_secret):
assert ner_api_secret and ner_api_secret != 'PLEASE_ADD_YOUR_OWN_GOOGLE_API_KEY_HERE', "Please add you Google API Key for Named Entity Recognition"
payload = {
"document": {
"type"... | 31.682927 | 157 | 0.666667 | import requests
import json
import requests
def remote_named_entity_recognition(document, ner_api_secret):
assert ner_api_secret and ner_api_secret != 'PLEASE_ADD_YOUR_OWN_GOOGLE_API_KEY_HERE', "Please add you Google API Key for Named Entity Recognition"
payload = {
"document": {
"type"... | true | true |
f72865253b701e5d6e9fa8098d954db0569c240b | 14,632 | py | Python | tests/hwsim/p2p_utils.py | coolshou/hostap | 836a075570d15eed02bda4c0065b2e4f75f7f303 | [
"Unlicense"
] | 9 | 2018-06-07T15:51:09.000Z | 2020-05-20T22:41:48.000Z | tests/hwsim/p2p_utils.py | besimaltnok/hostap-wpa3 | 2a0c65b3caa898d0720eb89a937c0c4ca5360548 | [
"Unlicense"
] | null | null | null | tests/hwsim/p2p_utils.py | besimaltnok/hostap-wpa3 | 2a0c65b3caa898d0720eb89a937c0c4ca5360548 | [
"Unlicense"
] | 6 | 2018-06-15T15:42:23.000Z | 2021-06-11T02:36:20.000Z | # P2P helper functions
# Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import threading
import time
import Queue
import hwsim_utils
MGMT_SUBTYPE_PROBE_REQ = 4
MGMT_SU... | 39.227882 | 117 | 0.652747 |
import logging
logger = logging.getLogger()
import threading
import time
import Queue
import hwsim_utils
MGMT_SUBTYPE_PROBE_REQ = 4
MGMT_SUBTYPE_ACTION = 13
ACTION_CATEG_PUBLIC = 4
P2P_GO_NEG_REQ = 0
P2P_GO_NEG_RESP = 1
P2P_GO_NEG_CONF = 2
P2P_INVITATION_REQ = 3
P2P_INVITATION_RESP = 4
P2P_DEV_DISC_REQ = 5
P2P... | false | true |
f728659e152b0ab0ac0b69c92e35428aa12d16bd | 1,546 | py | Python | scripts/practice/FB/DiameterofBinaryTree.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/practice/FB/DiameterofBinaryTree.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/practice/FB/DiameterofBinaryTree.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Given the root of a binary tree, return the length of the diameter of the tree.
The diameter of a binary tree is the length of the longest path between any two nodes in a tree.
This path may or may not pass through the root.
The length of a path between two nodes is represented by the number of edges between th... | 25.766667 | 97 | 0.641656 |
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def diameterOfBinaryTree(self, root):
diameter = 0
def longest_path(node):
if not node:
return 0
... | true | true |
f728661a3070ebaff8acf86cbb8fae3a9b6e04a3 | 548 | py | Python | exercises/fr/exc_01_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/exc_01_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/exc_01_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Importe le Matcher
from spacy.____ import ____
nlp = spacy.load("fr_core_news_sm")
doc = nlp("Le constructeur Citröen présente la e-Méhari Courrèges au public.")
# Initialise le matcher avec le vocabulaire partagé
matcher = ____(____.____)
# Crée un motif qui recherche les deux tokens : "e-Méhari" et... | 26.095238 | 79 | 0.74635 | import spacy
from spacy.____ import ____
nlp = spacy.load("fr_core_news_sm")
doc = nlp("Le constructeur Citröen présente la e-Méhari Courrèges au public.")
matcher = ____(____.____)
pattern = [____]
____.____("MEHARI_PATTERN", None, ____)
matches = ____
print("Résultats :", [doc[start:end].text for match_id,... | true | true |
f7286637c96bb881fbed2a35eadf81bc73e37593 | 284 | py | Python | plugins/trezor/__init__.py | zaapnetwork/electrum-zaap | eb7ce05300508eef9cdb55432ce58c842ce03661 | [
"MIT"
] | null | null | null | plugins/trezor/__init__.py | zaapnetwork/electrum-zaap | eb7ce05300508eef9cdb55432ce58c842ce03661 | [
"MIT"
] | null | null | null | plugins/trezor/__init__.py | zaapnetwork/electrum-zaap | eb7ce05300508eef9cdb55432ce58c842ce03661 | [
"MIT"
] | null | null | null | from electrum_zaap.i18n import _
fullname = 'TREZOR Wallet'
description = _('Provides support for TREZOR hardware wallet')
requires = [('trezorlib','github.com/trezor/python-trezor')]
registers_keystore = ('hardware', 'trezor', _("TREZOR wallet"))
available_for = ['qt', 'cmdline']
| 31.555556 | 63 | 0.735915 | from electrum_zaap.i18n import _
fullname = 'TREZOR Wallet'
description = _('Provides support for TREZOR hardware wallet')
requires = [('trezorlib','github.com/trezor/python-trezor')]
registers_keystore = ('hardware', 'trezor', _("TREZOR wallet"))
available_for = ['qt', 'cmdline']
| true | true |
f7286664ea8b95c1a36f0b84b6f8e95547a6c9ae | 1,154 | py | Python | lightkube/operators.py | addyess/lightkube | 3d2f4ab41bf9daa168e923f3b820d9379d6d56b6 | [
"MIT"
] | 63 | 2020-07-04T14:40:53.000Z | 2022-03-31T07:20:23.000Z | lightkube/operators.py | addyess/lightkube | 3d2f4ab41bf9daa168e923f3b820d9379d6d56b6 | [
"MIT"
] | 15 | 2021-10-13T16:11:04.000Z | 2022-03-28T21:34:50.000Z | lightkube/operators.py | addyess/lightkube | 3d2f4ab41bf9daa168e923f3b820d9379d6d56b6 | [
"MIT"
] | 6 | 2020-10-24T08:42:37.000Z | 2022-03-10T18:11:11.000Z | from typing import Iterable
__all__ = ['in_', 'not_in', 'exists', 'not_exists', 'equal', 'not_equal']
class Operator:
def __init__(self, op_name: str, op: str, value=None):
self.op = op
self.value = value
self.op_name = op_name
def encode(self, key):
return f"{key}{self.op}{s... | 21.773585 | 73 | 0.654246 | from typing import Iterable
__all__ = ['in_', 'not_in', 'exists', 'not_exists', 'equal', 'not_equal']
class Operator:
def __init__(self, op_name: str, op: str, value=None):
self.op = op
self.value = value
self.op_name = op_name
def encode(self, key):
return f"{key}{self.op}{s... | true | true |
f72866919f41f4941197312cfc63787e81a205c5 | 7,540 | py | Python | ambari-server/src/test/python/TestServerUpgrade.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/TestServerUpgrade.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/TestServerUpgrade.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | 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 use this ... | 39.270833 | 143 | 0.753581 |
import StringIO
import sys
from ambari_commons.exceptions import FatalException
from unittest import TestCase
from mock.mock import patch, MagicMock
from ambari_server.serverUpgrade import set_current, SetCurrentVersionOptions, upgrade_stack
import ambari_server
class TestServerUpgrade(TestCase):
@patch("ambari_s... | true | true |
f72866b84e4459ca6c2400a13d478a5eceb3c0df | 6,785 | py | Python | AR/exp/common/ntu_tools.py | YuJaceKim/Activity-Recognition-with-Combination-of-Deeply-Learned-Visual-Attention-and-Pose-Estimation | 23b9191f150d0edb981cf22a47a618feb55578b9 | [
"MIT"
] | 343 | 2018-07-18T10:39:30.000Z | 2022-03-30T02:32:06.000Z | AR/exp/common/ntu_tools.py | YuJaceKim/Activity-Recognition-with-Combination-of-Deeply-Learned-Visual-Attention-and-Pose-Estimation | 23b9191f150d0edb981cf22a47a618feb55578b9 | [
"MIT"
] | 47 | 2018-09-03T03:35:13.000Z | 2021-11-15T02:09:15.000Z | AR/exp/common/ntu_tools.py | YuJaceKim/Activity-Recognition-with-Combination-of-Deeply-Learned-Visual-Attention-and-Pose-Estimation | 23b9191f150d0edb981cf22a47a618feb55578b9 | [
"MIT"
] | 83 | 2018-10-15T08:36:12.000Z | 2022-03-05T05:51:16.000Z | import os
import numpy as np
import json
import time
from keras.callbacks import Callback
from deephar.data import BatchLoader
from deephar.utils import *
def eval_singleclip_gt_bbox_generator(model, datagen, verbose=1):
num_blocks = len(model.outputs)
num_samples = len(datagen)
start = time.time()
... | 32.777778 | 79 | 0.550479 | import os
import numpy as np
import json
import time
from keras.callbacks import Callback
from deephar.data import BatchLoader
from deephar.utils import *
def eval_singleclip_gt_bbox_generator(model, datagen, verbose=1):
num_blocks = len(model.outputs)
num_samples = len(datagen)
start = time.time()
... | true | true |
f7286704124989985083256db66a9323c4428a17 | 9,820 | py | Python | src/ocr_recog/ocr_recognizer.py | deepguider/RoadGPS | 7db4669a54da98a854886b89b6922fb8c7a60f33 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-05-22T12:47:34.000Z | 2019-05-23T15:43:47.000Z | src/ocr_recog/ocr_recognizer.py | deepguider/RoadGPS | 7db4669a54da98a854886b89b6922fb8c7a60f33 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/ocr_recog/ocr_recognizer.py | deepguider/RoadGPS | 7db4669a54da98a854886b89b6922fb8c7a60f33 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-08-09T06:50:46.000Z | 2019-08-09T06:50:46.000Z | import os
os.environ["CUDA_VISIBLE_DEVICES"]="0" #CUDA_VISIBLE_DEVICES=0 (always use the first GPU only)
import time
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.utils.data
from utils import AttnLabelConverter
from model import Model
from demo import detect_ocr
from ... | 49.847716 | 1,047 | 0.694297 | import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import time
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.utils.data
from utils import AttnLabelConverter
from model import Model
from demo import detect_ocr
from craft.craft import CRAFT
from collections import Ordere... | true | true |
f728670877d053e632b4338aad097a6f4ee52456 | 31,108 | py | Python | cherrypy/lib/sessions.py | marlenebDC/cherrypy | b68087d0d62a8817e90a509a89afad0268052bc2 | [
"BSD-3-Clause"
] | null | null | null | cherrypy/lib/sessions.py | marlenebDC/cherrypy | b68087d0d62a8817e90a509a89afad0268052bc2 | [
"BSD-3-Clause"
] | null | null | null | cherrypy/lib/sessions.py | marlenebDC/cherrypy | b68087d0d62a8817e90a509a89afad0268052bc2 | [
"BSD-3-Clause"
] | 1 | 2019-11-22T16:17:17.000Z | 2019-11-22T16:17:17.000Z | """Session implementation for CherryPy.
You need to edit your config file to use sessions. Here's an example::
[/]
tools.sessions.on = True
tools.sessions.storage_class = cherrypy.lib.sessions.FileSession
tools.sessions.storage_path = "/home/site/sessions"
tools.sessions.timeout = 60
This sets th... | 34.035011 | 81 | 0.604764 | import sys
import datetime
import os
import time
import threading
import binascii
import pickle
import contextlib
import zc.lockfile
import cherrypy
from cherrypy.lib import httputil
from cherrypy.lib import locking
from cherrypy.lib import is_iterator
missing = object()
class Session(object):
_id = None
... | true | true |
f728679da2cbbe5e08e576b6cf2384744f285382 | 13,155 | py | Python | payflowpro/client.py | glassfordm/python-payflowpro | d9f11acf9bdf5f7984853a2a5be408013e660ac0 | [
"Apache-2.0"
] | null | null | null | payflowpro/client.py | glassfordm/python-payflowpro | d9f11acf9bdf5f7984853a2a5be408013e660ac0 | [
"Apache-2.0"
] | null | null | null | payflowpro/client.py | glassfordm/python-payflowpro | d9f11acf9bdf5f7984853a2a5be408013e660ac0 | [
"Apache-2.0"
] | 1 | 2020-10-15T16:34:36.000Z | 2020-10-15T16:34:36.000Z | """
Copyright 2008 Online Agility (www.onlineagility.com)
Copyright 2009 John D'Agostino (http://www.mercurycomplex.com)
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/lic... | 39.151786 | 121 | 0.600988 | """
Copyright 2008 Online Agility (www.onlineagility.com)
Copyright 2009 John D'Agostino (http://www.mercurycomplex.com)
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/lic... | false | true |
f7286841416be878bd48fb75ac4def85bc0b75bf | 357 | py | Python | src/config.py | malberich/abtest_splitter | 0f66c0600462835b72ccbbf07484b49bb7b6006a | [
"MIT"
] | null | null | null | src/config.py | malberich/abtest_splitter | 0f66c0600462835b72ccbbf07484b49bb7b6006a | [
"MIT"
] | null | null | null | src/config.py | malberich/abtest_splitter | 0f66c0600462835b72ccbbf07484b49bb7b6006a | [
"MIT"
] | null | null | null | """Configuration file loader for the experiments configuration."""
import yaml
def load_config():
"""Load the app configuration file."""
with open('../conf/experiments.yaml', 'r') as config_file:
try:
return yaml.safe_load(config_file)
except yaml.YAMLError as exc:
prin... | 23.8 | 66 | 0.64986 | import yaml
def load_config():
with open('../conf/experiments.yaml', 'r') as config_file:
try:
return yaml.safe_load(config_file)
except yaml.YAMLError as exc:
print(exc)
EXPERIMENTS = load_config()
| true | true |
f7286985bee169e43770e47d44b7e012e96e2726 | 393 | py | Python | multiple-languages/python/ros-cdk-rocketmq-1.0.3/src/ros_cdk_rocketmq/_jsii/__init__.py | aliyun/Resource-Orchestration-Service-Cloud-Development-K | 2b81e135002ed81cb72f7d07be7ff497ea39e2e1 | [
"Apache-2.0"
] | 15 | 2020-11-10T02:00:28.000Z | 2022-02-07T19:28:10.000Z | multiple-languages/python/ros-cdk-rocketmq-1.0.3/src/ros_cdk_rocketmq/_jsii/__init__.py | aliyun/Resource-Orchestration-Service-Cloud-Development-K | 2b81e135002ed81cb72f7d07be7ff497ea39e2e1 | [
"Apache-2.0"
] | 23 | 2021-02-02T04:37:02.000Z | 2022-03-31T06:41:06.000Z | multiple-languages/python/ros-cdk-rocketmq-1.0.3/src/ros_cdk_rocketmq/_jsii/__init__.py | aliyun/Resource-Orchestration-Service-Cloud-Development-K | 2b81e135002ed81cb72f7d07be7ff497ea39e2e1 | [
"Apache-2.0"
] | 4 | 2021-01-13T05:48:43.000Z | 2022-03-15T11:26:48.000Z | import abc
import builtins
import datetime
import enum
import typing
import jsii
import publication
import typing_extensions
import constructs._jsii
import ros_cdk_core._jsii
__jsii_assembly__ = jsii.JSIIAssembly.load(
"@alicloud/ros-cdk-rocketmq",
"1.0.3",
__name__[0:-6],
"ros-cdk-rocketmq@1.0.3.jsi... | 15.115385 | 43 | 0.740458 | import abc
import builtins
import datetime
import enum
import typing
import jsii
import publication
import typing_extensions
import constructs._jsii
import ros_cdk_core._jsii
__jsii_assembly__ = jsii.JSIIAssembly.load(
"@alicloud/ros-cdk-rocketmq",
"1.0.3",
__name__[0:-6],
"ros-cdk-rocketmq@1.0.3.jsi... | true | true |
f7286a036e0c3708992636385b8a410efb00c43b | 1,666 | py | Python | dualtext_server/dualtext_api/views/project_views.py | mathislucka/dualtext | 70cf7734cd66e60e482e2df09a3341224687526f | [
"MIT"
] | 1 | 2021-08-16T20:21:11.000Z | 2021-08-16T20:21:11.000Z | dualtext_server/dualtext_api/views/project_views.py | mathislucka/dualtext | 70cf7734cd66e60e482e2df09a3341224687526f | [
"MIT"
] | null | null | null | dualtext_server/dualtext_api/views/project_views.py | mathislucka/dualtext | 70cf7734cd66e60e482e2df09a3341224687526f | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from rest_framework import generics, status
from rest_framework.response import Response
from rest_framework.views import APIView
from dualtext_api.models import Project
from dualtext_api.serializers import ProjectSerializer
from dualtext_api.permissions import MembersRead... | 40.634146 | 87 | 0.762905 | from django.shortcuts import get_object_or_404
from rest_framework import generics, status
from rest_framework.response import Response
from rest_framework.views import APIView
from dualtext_api.models import Project
from dualtext_api.serializers import ProjectSerializer
from dualtext_api.permissions import MembersRead... | true | true |
f7286a73b5108fab8b3568f250e7067d363a006c | 3,724 | py | Python | advice-road-crop/roadnet/train_valid_split.py | fada-catec/advice_AI4EU_experiment | fa65f771102d299bfc84722bed44337271f944aa | [
"MIT"
] | 6 | 2020-12-05T09:03:31.000Z | 2022-03-04T13:14:32.000Z | roadnet/train_valid_split.py | linbaiwpi/RoadNet-RT | 624a1051e0502b60abe6122450ea53f80e9e4f8a | [
"MIT"
] | null | null | null | roadnet/train_valid_split.py | linbaiwpi/RoadNet-RT | 624a1051e0502b60abe6122450ea53f80e9e4f8a | [
"MIT"
] | null | null | null | import os
import shutil
import random
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from PIL import Image
random.seed(2020)
IMG_CROP = True
# save gt_image_2 into gt_image, so that road is assigned to 255 and non-road is 0
train_gt_path = "../../data_road/training/gt_image_2/"
save_gt_path... | 26.985507 | 82 | 0.655478 | import os
import shutil
import random
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from PIL import Image
random.seed(2020)
IMG_CROP = True
train_gt_path = "../../data_road/training/gt_image_2/"
save_gt_path = "../../data_road/training/gt_image/"
gt_list = [f for f in os.listdir(train_gt_... | true | true |
f7286ace2c69167571c07c9da6f8d95e7dbd792c | 526 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/cv01-33948 | 9c0e5b756a9742254ea82a6b71220e7c86397002 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/cv01-33948 | 9c0e5b756a9742254ea82a6b71220e7c86397002 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/cv01-33948 | 9c0e5b756a9742254ea82a6b71220e7c86397002 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "cv01-33948.botics.co"
site_params = {
"name": "cv01",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_create(default... | 20.230769 | 61 | 0.65019 | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "cv01-33948.botics.co"
site_params = {
"name": "cv01",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_create(default... | true | true |
f7286b016acbeca564ced83432a01b33959f17d9 | 5,948 | py | Python | tests/dtypes_test.py | adler-j/jax | 3d7f884ccfe15da1b218903b37b255769223b4cf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/dtypes_test.py | adler-j/jax | 3d7f884ccfe15da1b218903b37b255769223b4cf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/dtypes_test.py | adler-j/jax | 3d7f884ccfe15da1b218903b37b255769223b4cf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.623377 | 85 | 0.654506 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import operator
import unittest
import six
if six.PY3:
import enum
from absl.testing import absltest
from absl.testing import parameterized
import numpy as onp
import jax
f... | true | true |
f7286b47a0b791119d34c1ba81a5aa98561f12ad | 2,630 | py | Python | levenshtein_distance.py | albert-espin/levenshtein-dist | 8a2e7453195756e5bc195d3f88619d0998fef2d3 | [
"MIT"
] | null | null | null | levenshtein_distance.py | albert-espin/levenshtein-dist | 8a2e7453195756e5bc195d3f88619d0998fef2d3 | [
"MIT"
] | null | null | null | levenshtein_distance.py | albert-espin/levenshtein-dist | 8a2e7453195756e5bc195d3f88619d0998fef2d3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import time
# DEFINICIÓ DE CONSTANTS (per fer més comprensible l'anàlisi del codi):
DELETION_COST = 2
INSERTION_COST = 1
SUBSTITUTION_COST = 1
def main():
pattern = "ALGORITHM"
text = "ADVANCED"
t = time.clock()
print u"DISTÀNCIA DE LEVENSHTEIN:... | 37.042254 | 474 | 0.631179 |
import sys
import time
DELETION_COST = 2
INSERTION_COST = 1
SUBSTITUTION_COST = 1
def main():
pattern = "ALGORITHM"
text = "ADVANCED"
t = time.clock()
print u"DISTÀNCIA DE LEVENSHTEIN:\nPatró: {}\nText: {}\n\nCost d'eliminació: {}\nCost d'inserció: {}\nCost de substitució: {}\n".format(pattern,... | false | true |
f7286b7177da4a0237e472b82963ce295b3c4ff0 | 9,956 | py | Python | journeylog/migrations/0001_initial_squashed_0003_auto_20181014_0556.py | soulweaver91/journeylog-be | ce3fd676d393605254fec3fd9727770d93b3609f | [
"MIT"
] | null | null | null | journeylog/migrations/0001_initial_squashed_0003_auto_20181014_0556.py | soulweaver91/journeylog-be | ce3fd676d393605254fec3fd9727770d93b3609f | [
"MIT"
] | 6 | 2019-04-28T23:32:30.000Z | 2021-09-18T23:21:51.000Z | journeylog/migrations/0001_initial_squashed_0003_auto_20181014_0556.py | soulweaver91/journeylog-be | ce3fd676d393605254fec3fd9727770d93b3609f | [
"MIT"
] | 1 | 2020-12-29T15:17:55.000Z | 2020-12-29T15:17:55.000Z | # Generated by Django 2.1 on 2018-10-14 02:57
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.functions.comparison
import re
class Migration(migrations.Migration):
replaces = [('journeylog', '0001_initial'), ('journeylog', '0002_aut... | 53.526882 | 777 | 0.57262 |
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.functions.comparison
import re
class Migration(migrations.Migration):
replaces = [('journeylog', '0001_initial'), ('journeylog', '0002_auto_20181014_0546'), ('journeylog', '0003_auto_... | true | true |
f7286c36f71071c90ef94cac759a86bfa53d77c7 | 16,233 | py | Python | lisa/node.py | Abdelrahman0W/lisa | cd85034d83880b9fe6a50c7de817071a943ae39b | [
"MIT"
] | null | null | null | lisa/node.py | Abdelrahman0W/lisa | cd85034d83880b9fe6a50c7de817071a943ae39b | [
"MIT"
] | null | null | null | lisa/node.py | Abdelrahman0W/lisa | cd85034d83880b9fe6a50c7de817071a943ae39b | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from __future__ import annotations
from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath
from random import randint
from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar, Union, cast
from lisa import schema
from lis... | 30.513158 | 88 | 0.595084 |
from __future__ import annotations
from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath
from random import randint
from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar, Union, cast
from lisa import schema
from lisa.executable import Tools
from lisa.feature import Features
from lisa.o... | true | true |
f7286c4cfe10efa0c634c024f8dd2ceb244da2ab | 1,598 | py | Python | src/ad/admin.py | mio-eldar/ads-board | f53a5aabcff5ba8cab4e92f58baaf5017506bbd4 | [
"MIT"
] | null | null | null | src/ad/admin.py | mio-eldar/ads-board | f53a5aabcff5ba8cab4e92f58baaf5017506bbd4 | [
"MIT"
] | null | null | null | src/ad/admin.py | mio-eldar/ads-board | f53a5aabcff5ba8cab4e92f58baaf5017506bbd4 | [
"MIT"
] | null | null | null | from django.contrib import admin
from imagekit.admin import AdminThumbnail
from mptt.admin import DraggableMPTTAdmin
from ad.models import City, \
Category, AdvertisementImage, Advertisement
class SubCategoryInline(admin.TabularInline):
model = Category
extra = 14
exclude = ('icon', 'slug')
class ... | 26.633333 | 97 | 0.645807 | from django.contrib import admin
from imagekit.admin import AdminThumbnail
from mptt.admin import DraggableMPTTAdmin
from ad.models import City, \
Category, AdvertisementImage, Advertisement
class SubCategoryInline(admin.TabularInline):
model = Category
extra = 14
exclude = ('icon', 'slug')
class ... | true | true |
f7286cc0f043e840d3c07edbdea02c22e3394f40 | 1,049 | py | Python | unleash/plugins/footer.py | mbr/unleash | f36c6e6600868bc054f5b8d4cf1c03ea8eb8da4c | [
"MIT"
] | 5 | 2015-05-29T21:51:44.000Z | 2019-09-16T16:59:46.000Z | unleash/plugins/footer.py | mbr/unleash | f36c6e6600868bc054f5b8d4cf1c03ea8eb8da4c | [
"MIT"
] | null | null | null | unleash/plugins/footer.py | mbr/unleash | f36c6e6600868bc054f5b8d4cf1c03ea8eb8da4c | [
"MIT"
] | null | null | null | from click import Option
from unleash import opts, log, commit
from unleash import __version__ as unleash_version
PLUGIN_NAME = 'footer'
# make sure version info is written first, so the footer does not get
# overwritten
PLUGIN_DEPENDS = ['versions']
FOOTER_FORMAT = u'\n[commit by unleash {}]\n'
def setup(cli):
... | 27.605263 | 77 | 0.673022 | from click import Option
from unleash import opts, log, commit
from unleash import __version__ as unleash_version
PLUGIN_NAME = 'footer'
PLUGIN_DEPENDS = ['versions']
FOOTER_FORMAT = u'\n[commit by unleash {}]\n'
def setup(cli):
cli.commands['release'].params.append(Option(
['--footer/--no-footer',... | true | true |
f7286cf83d441069fec4a82586b6aab0a0b7848e | 16,514 | py | Python | scipy/linalg/lapack.py | ZHG2017/scipy | 4fe52aed1ea375c2aa7a2a6b634787c9abdf32e3 | [
"BSD-3-Clause"
] | 1 | 2021-05-22T21:07:15.000Z | 2021-05-22T21:07:15.000Z | scipy/linalg/lapack.py | ZHG2017/scipy | 4fe52aed1ea375c2aa7a2a6b634787c9abdf32e3 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T20:19:36.000Z | 2021-04-03T20:19:36.000Z | scipy/linalg/lapack.py | YarivLevy81/scipy | 859c1061b3d5aa30c4466824049d69edde5499a2 | [
"BSD-3-Clause"
] | 1 | 2020-06-28T00:46:20.000Z | 2020-06-28T00:46:20.000Z | """
Low-level LAPACK functions (:mod:`scipy.linalg.lapack`)
=======================================================
This module contains low-level functions from the LAPACK library.
The `*gegv` family of routines have been removed from LAPACK 3.6.0
and have been deprecated in SciPy 0.17.0. They will be removed in
a f... | 15.802871 | 79 | 0.641274 |
import numpy as _np
from .blas import _get_funcs, _memoize_get_funcs
from scipy.linalg import _flapack
from re import compile as regex_compile
try:
from scipy.linalg import _clapack
except ImportError:
_clapack = None
try:
from scipy.linalg import _flapack_64
HAS_ILP64 = True
except ImportError:
... | true | true |
f7286d5721ce44c652e278ca9b476680524bd3e9 | 4,166 | py | Python | code-sample-python/python_django_prometheus/metrics_app/views.py | aquatir/learntocode | 9b860a528ded64fab2686a93c49dfd4b3947d6c9 | [
"MIT"
] | null | null | null | code-sample-python/python_django_prometheus/metrics_app/views.py | aquatir/learntocode | 9b860a528ded64fab2686a93c49dfd4b3947d6c9 | [
"MIT"
] | null | null | null | code-sample-python/python_django_prometheus/metrics_app/views.py | aquatir/learntocode | 9b860a528ded64fab2686a93c49dfd4b3947d6c9 | [
"MIT"
] | null | null | null | import os
import time
from random import SystemRandom
from django.contrib.auth.models import User, Group
from django.http import HttpResponse
from prometheus_client import Counter, Gauge, Summary, Histogram, Info, Enum
from rest_framework import viewsets, permissions
from metrics_app.models import MyModel
from metric... | 31.801527 | 98 | 0.705473 | import os
import time
from random import SystemRandom
from django.contrib.auth.models import User, Group
from django.http import HttpResponse
from prometheus_client import Counter, Gauge, Summary, Histogram, Info, Enum
from rest_framework import viewsets, permissions
from metrics_app.models import MyModel
from metric... | true | true |
f7286dada8d628be90f9f2661246fdf96eb66692 | 3,465 | py | Python | GBDT_modeling.py | Expert68/hotel_recommendation | a6c1035c7e3ff2d824039855a2349b50f9143d37 | [
"Apache-2.0"
] | 1 | 2019-03-08T13:54:36.000Z | 2019-03-08T13:54:36.000Z | GBDT_modeling.py | Expert68/hotel_recommendation | a6c1035c7e3ff2d824039855a2349b50f9143d37 | [
"Apache-2.0"
] | null | null | null | GBDT_modeling.py | Expert68/hotel_recommendation | a6c1035c7e3ff2d824039855a2349b50f9143d37 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import xgboost as xgb
import h5py
import os
from data_clean import pre_process,get_agg
#------------------------------定义评估标准---------------------------
def map5eval(preds,dtrain):
actual = dtrain.get_label()
predicted =... | 39.827586 | 175 | 0.672439 | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import xgboost as xgb
import h5py
import os
from data_clean import pre_process,get_agg
def map5eval(preds,dtrain):
actual = dtrain.get_label()
predicted = preds.argsort(axis=1)[:-np.arange(5)]
metric = 0
for i ... | true | true |
f7286fee62b804e76ae5e3b2c1c9de15c8e30622 | 3,640 | py | Python | research/attention_ocr/python/demo_inference.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/attention_ocr/python/demo_inference.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/attention_ocr/python/demo_inference.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | """A script to run inference on a set of image files.
NOTE #1: The Attention OCR model was trained only using FSNS train dataset and
it will work only for images which look more or less similar to french street
names. In order to apply it to images from a different distribution you need
to retrain (or at least fi... | 37.525773 | 79 | 0.721978 | import numpy as np
import PIL.Image
import tensorflow as tf
from tensorflow.python.platform import flags
from tensorflow.python.training import monitored_session
import common_flags
import datasets
import data_provider
FLAGS = flags.FLAGS
common_flags.define()
flags.DEFINE_string('image_path_pattern'... | true | true |
f7287025fb43af465e1046aa25afa2d4b26bb484 | 537 | py | Python | scrape_ims/scrapy/scrape_dogs/scrape_dogs/items.py | nateGeorge/IDmyDog-udacity-submission | d247f03455ea4e72898fe80a6bf577e9c1cedc6d | [
"MIT"
] | null | null | null | scrape_ims/scrapy/scrape_dogs/scrape_dogs/items.py | nateGeorge/IDmyDog-udacity-submission | d247f03455ea4e72898fe80a6bf577e9c1cedc6d | [
"MIT"
] | null | null | null | scrape_ims/scrapy/scrape_dogs/scrape_dogs/items.py | nateGeorge/IDmyDog-udacity-submission | d247f03455ea4e72898fe80a6bf577e9c1cedc6d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class AKCItem(scrapy.Item):
image_urls = scrapy.Field()
images = scrapy.Field()
breed = scrapy.Field()
link = scrapy.Field()
desc... | 23.347826 | 51 | 0.64432 |
import scrapy
class AKCItem(scrapy.Item):
image_urls = scrapy.Field()
images = scrapy.Field()
breed = scrapy.Field()
link = scrapy.Field()
desc = scrapy.Field()
thumb = scrapy.Field()
class WikiItem(scrapy.Item):
image_urls = scrapy.Field()
images = scrapy.Field()
br... | true | true |
f7287099910ac5f81a31174981d45c2f9db6131d | 626 | py | Python | migrations/versions/4432129ea292_.py | Brenda-M/food-booth | 8fbdb6be12653d18cd74b464af017e83f16a6feb | [
"MIT"
] | null | null | null | migrations/versions/4432129ea292_.py | Brenda-M/food-booth | 8fbdb6be12653d18cd74b464af017e83f16a6feb | [
"MIT"
] | null | null | null | migrations/versions/4432129ea292_.py | Brenda-M/food-booth | 8fbdb6be12653d18cd74b464af017e83f16a6feb | [
"MIT"
] | null | null | null | """empty message
Revision ID: 4432129ea292
Revises:
Create Date: 2020-05-13 18:27:44.141674
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4432129ea292'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 21.586207 | 75 | 0.680511 | from alembic import op
import sqlalchemy as sa
revision = '4432129ea292'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f728714125957024001924ac6e16f83aff66e02c | 12,835 | py | Python | AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-12T14:13:45.000Z | 2022-03-12T14:13:45.000Z | AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | 2 | 2022-01-13T04:29:38.000Z | 2022-03-12T01:05:31.000Z | AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13751579: Asset Picker UI/UX
"""
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
from ... | 49.555985 | 118 | 0.634671 |
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.legacy.general as general
import azlmbr.paths
import azlmbr.math as math
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', ... | true | true |
f728727e32c5dfe9829d0c741c9d10726176a45c | 2,426 | py | Python | scrape_scripts/textScrape.py | bmcmenamin/word2vec_advice | 69dbde89b26b80d10f778147f2e3abe1628d6e05 | [
"MIT"
] | null | null | null | scrape_scripts/textScrape.py | bmcmenamin/word2vec_advice | 69dbde89b26b80d10f778147f2e3abe1628d6e05 | [
"MIT"
] | null | null | null | scrape_scripts/textScrape.py | bmcmenamin/word2vec_advice | 69dbde89b26b80d10f778147f2e3abe1628d6e05 | [
"MIT"
] | null | null | null | #!/Users/mcmenamin/.virtualenvs/py3env/bin/python
from lxml import html
import requests
from datetime import date
import numpy as np
import pandas as pd
import re as re
from itertools import chain
import pickle
from tqdm import tqdm
def getURLforYear(year, archiveURL='http://www.uexpress.com/dearabby/archives'):
... | 28.880952 | 88 | 0.623248 |
from lxml import html
import requests
from datetime import date
import numpy as np
import pandas as pd
import re as re
from itertools import chain
import pickle
from tqdm import tqdm
def getURLforYear(year, archiveURL='http://www.uexpress.com/dearabby/archives'):
archive = requests.get('{0}/{1}'.format(archi... | true | true |
f72872f61f7ef7659da0b278733dd6073c996977 | 22,691 | py | Python | tests/integration/test_process.py | martinskans/mapillary_tools | ac15996ce4d2a499e6d9ba10af5c23126e535222 | [
"BSD-2-Clause"
] | null | null | null | tests/integration/test_process.py | martinskans/mapillary_tools | ac15996ce4d2a499e6d9ba10af5c23126e535222 | [
"BSD-2-Clause"
] | null | null | null | tests/integration/test_process.py | martinskans/mapillary_tools | ac15996ce4d2a499e6d9ba10af5c23126e535222 | [
"BSD-2-Clause"
] | null | null | null | import json
import os
import subprocess
import zipfile
import hashlib
import pytest
import py.path
import exifread
EXECUTABLE = os.getenv("MAPILLARY_TOOLS_EXECUTABLE", "python3 -m mapillary_tools")
IMPORT_PATH = "tests/integration/mapillary_tools_process_images_provider/data"
USERNAME = "test_username_MAKE_SURE_IT_IS... | 33.369118 | 186 | 0.623287 | import json
import os
import subprocess
import zipfile
import hashlib
import pytest
import py.path
import exifread
EXECUTABLE = os.getenv("MAPILLARY_TOOLS_EXECUTABLE", "python3 -m mapillary_tools")
IMPORT_PATH = "tests/integration/mapillary_tools_process_images_provider/data"
USERNAME = "test_username_MAKE_SURE_IT_IS... | true | true |
f728735a0a2cd2a637b30db6ca8659076398b7a8 | 4,417 | py | Python | examples/sac.py | vincentlui/unsupervised-goal-conditioned-rl | 4f2e6938e072cb52f8ee779a939fe7bf6a980d45 | [
"MIT"
] | null | null | null | examples/sac.py | vincentlui/unsupervised-goal-conditioned-rl | 4f2e6938e072cb52f8ee779a939fe7bf6a980d45 | [
"MIT"
] | null | null | null | examples/sac.py | vincentlui/unsupervised-goal-conditioned-rl | 4f2e6938e072cb52f8ee779a939fe7bf6a980d45 | [
"MIT"
] | null | null | null | from gym.envs.mujoco import HalfCheetahEnv
import argparse
import gym
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.env_replay_buffer import EnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.launchers.launcher_util import setup_logger
from rlkit.samplers.data_collector impo... | 32.962687 | 127 | 0.672628 | from gym.envs.mujoco import HalfCheetahEnv
import argparse
import gym
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.env_replay_buffer import EnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.launchers.launcher_util import setup_logger
from rlkit.samplers.data_collector impo... | true | true |
f72874a50d223d4834382995b21fd851e0fdff25 | 75 | py | Python | simpleArraySum.py | ariz-ahmad/hackerrank-algorithms | e7fbce8581a1e502aa4b37313351f742f73b62ff | [
"MIT"
] | null | null | null | simpleArraySum.py | ariz-ahmad/hackerrank-algorithms | e7fbce8581a1e502aa4b37313351f742f73b62ff | [
"MIT"
] | null | null | null | simpleArraySum.py | ariz-ahmad/hackerrank-algorithms | e7fbce8581a1e502aa4b37313351f742f73b62ff | [
"MIT"
] | null | null | null | def simpleArraySum(ar):
# sum() function works on lists
return sum(ar) | 25 | 32 | 0.706667 | def simpleArraySum(ar):
return sum(ar) | true | true |
f72874af72e89ceba6c537a1f15babc566ebbff2 | 169 | py | Python | integrations/__init__.py | IgorHoholko/metrics | 5510ccd99eaec5ab8175bbd5e2ad9e66e82d10e4 | [
"Apache-2.0"
] | 1 | 2021-05-16T11:36:04.000Z | 2021-05-16T11:36:04.000Z | integrations/__init__.py | IgorHoholko/metrics | 5510ccd99eaec5ab8175bbd5e2ad9e66e82d10e4 | [
"Apache-2.0"
] | null | null | null | integrations/__init__.py | IgorHoholko/metrics | 5510ccd99eaec5ab8175bbd5e2ad9e66e82d10e4 | [
"Apache-2.0"
] | null | null | null | import operator
from torchmetrics.utilities.imports import _compare_version
_LIGHTNING_GREATER_EQUAL_1_3 = _compare_version("pytorch_lightning", operator.ge, "1.3.0")
| 28.166667 | 90 | 0.840237 | import operator
from torchmetrics.utilities.imports import _compare_version
_LIGHTNING_GREATER_EQUAL_1_3 = _compare_version("pytorch_lightning", operator.ge, "1.3.0")
| true | true |
f72874d120229a1b88e2d6714969c996d23a2339 | 28,165 | py | Python | src/pretix/presale/views/event.py | bhaettasch/pretix | 5e355b400573783bdd17b1352aefcb36b0efc3f6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/presale/views/event.py | bhaettasch/pretix | 5e355b400573783bdd17b1352aefcb36b0efc3f6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/presale/views/event.py | bhaettasch/pretix | 5e355b400573783bdd17b1352aefcb36b0efc3f6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import calendar
import sys
from collections import defaultdict
from datetime import date, datetime, timedelta
from decimal import Decimal
from importlib import import_module
import isoweek
import pytz
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db.models import (
... | 46.400329 | 160 | 0.606994 | import calendar
import sys
from collections import defaultdict
from datetime import date, datetime, timedelta
from decimal import Decimal
from importlib import import_module
import isoweek
import pytz
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db.models import (
... | true | true |
f728752e4a893f2f382eb0826510c850d1a5bf78 | 640 | py | Python | setup.py | ucsb-pstat/jupyter-rsession-proxy | 47552352ff19e9dc015ae2da50ae9b2eeec89b54 | [
"BSD-3-Clause"
] | 1 | 2020-01-31T09:54:06.000Z | 2020-01-31T09:54:06.000Z | setup.py | scivm/jupyter-rsession-proxy | 8d1bbd0254944c35686198d3ce03ab1776c48a29 | [
"BSD-3-Clause"
] | null | null | null | setup.py | scivm/jupyter-rsession-proxy | 8d1bbd0254944c35686198d3ce03ab1776c48a29 | [
"BSD-3-Clause"
] | null | null | null | import setuptools
setuptools.setup(
name="jupyter-rsession-proxy",
version='1.0dev',
url="https://github.com/jupyterhub/jupyter-rsession-proxy",
author="Ryan Lovett & Yuvi Panda",
description="Jupyter extension to proxy RStudio's rsession",
packages=setuptools.find_packages(),
keywords=['Jupyt... | 26.666667 | 64 | 0.65 | import setuptools
setuptools.setup(
name="jupyter-rsession-proxy",
version='1.0dev',
url="https://github.com/jupyterhub/jupyter-rsession-proxy",
author="Ryan Lovett & Yuvi Panda",
description="Jupyter extension to proxy RStudio's rsession",
packages=setuptools.find_packages(),
keywords=['Jupyt... | true | true |
f7287564eb28c49e89edff884c44b57881472382 | 901 | py | Python | k8spackage/commands/version.py | ant31/k8spackage-crd | dd79657389ead5e153a552bfb380f3915f7943d3 | [
"Apache-2.0"
] | null | null | null | k8spackage/commands/version.py | ant31/k8spackage-crd | dd79657389ead5e153a552bfb380f3915f7943d3 | [
"Apache-2.0"
] | null | null | null | k8spackage/commands/version.py | ant31/k8spackage-crd | dd79657389ead5e153a552bfb380f3915f7943d3 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function
import k8spackage
from k8spackage.commands.command_base import CommandBase
class VersionCmd(CommandBase):
name = 'version'
help_message = "show version"
def __init__(self, options):
super(VersionCmd, self).__init__(options)
... | 25.742857 | 64 | 0.679245 | from __future__ import absolute_import, division, print_function
import k8spackage
from k8spackage.commands.command_base import CommandBase
class VersionCmd(CommandBase):
name = 'version'
help_message = "show version"
def __init__(self, options):
super(VersionCmd, self).__init__(options)
... | true | true |
f72876b7d8eb365c8c41991b4115489692254a89 | 8,591 | py | Python | openclean_pattern/utils/utils.py | VIDA-NYU/openclean-pattern | 8d8a94691f9bfa5dcf8773b08ceb8e562fce52df | [
"BSD-3-Clause"
] | 4 | 2021-04-20T09:05:51.000Z | 2022-01-28T14:13:37.000Z | openclean_pattern/utils/utils.py | VIDA-NYU/openclean-pattern | 8d8a94691f9bfa5dcf8773b08ceb8e562fce52df | [
"BSD-3-Clause"
] | 1 | 2021-04-09T08:49:33.000Z | 2021-04-09T08:49:33.000Z | openclean_pattern/utils/utils.py | VIDA-NYU/openclean-pattern | 8d8a94691f9bfa5dcf8773b08ceb8e562fce52df | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the Pattern and Anomaly Detection Library (openclean_pattern).
#
# Copyright (C) 2021 New York University.
#
# openclean_pattern is released under the Revised BSD License. See file LICENSE for
# full license details.
"""A collection of useful utility methods"""
import re
from abc import ABCMeta... | 30.572954 | 116 | 0.579444 |
import re
from abc import ABCMeta, abstractmethod
import random
import bisect
from collections import Counter
class Comparator(metaclass=ABCMeta):
@abstractmethod
def compare(self, a, b, meta=None):
raise NotImplementedError()
class StringComparator(Comparator):
@staticmethod
def... | true | true |
f72876d778a8e2b83e563d9d86d02501fb609ea5 | 920 | py | Python | src/project/wsgi.py | fahadalmutairi/edgetest | cc37a9cd53da74bd32f69f7a099679bccf0268a7 | [
"MIT"
] | null | null | null | src/project/wsgi.py | fahadalmutairi/edgetest | cc37a9cd53da74bd32f69f7a099679bccf0268a7 | [
"MIT"
] | null | null | null | src/project/wsgi.py | fahadalmutairi/edgetest | cc37a9cd53da74bd32f69f7a099679bccf0268a7 | [
"MIT"
] | null | null | null | """
WSGI config for project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.production")
from dja... | 30.666667 | 79 | 0.75 | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.production")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
from django.conf import settings
if settings.DEBUG:
try:
import django.views.debug
import six
from werkzeug.debug... | true | true |
f72877481dde1a80618e5757bcee6e91a830d0a1 | 1,730 | py | Python | d3rlpy-master/tests/dynamics/torch/test_probabilistic_ensemble_dynamics_impl.py | SOPR-T/SOPR-T | 3242461fa8b3e917cde70be497beb1158a7b27e6 | [
"MIT"
] | 1 | 2021-07-09T22:39:28.000Z | 2021-07-09T22:39:28.000Z | tests/dynamics/torch/test_probabilistic_ensemble_dynamics_impl.py | astrojuanlu/d3rlpy | e27852664647b7774f56ec775437b0ca73a24f3f | [
"MIT"
] | null | null | null | tests/dynamics/torch/test_probabilistic_ensemble_dynamics_impl.py | astrojuanlu/d3rlpy | e27852664647b7774f56ec775437b0ca73a24f3f | [
"MIT"
] | null | null | null | import pytest
from d3rlpy.dynamics.torch.probabilistic_ensemble_dynamics_impl import (
ProbabilisticEnsembleDynamicsImpl,
)
from d3rlpy.models.encoders import DefaultEncoderFactory
from d3rlpy.models.optimizers import AdamFactory
from tests.algos.algo_test import DummyActionScaler, DummyScaler
from tests.dynamics.... | 35.306122 | 78 | 0.760116 | import pytest
from d3rlpy.dynamics.torch.probabilistic_ensemble_dynamics_impl import (
ProbabilisticEnsembleDynamicsImpl,
)
from d3rlpy.models.encoders import DefaultEncoderFactory
from d3rlpy.models.optimizers import AdamFactory
from tests.algos.algo_test import DummyActionScaler, DummyScaler
from tests.dynamics.... | true | true |
f728777d43e9d57d72069d624f8ac3b9c45d8173 | 21,643 | py | Python | wizard.py | ubergeek42/lambda-lets-encrypt | 01e81577dabc984b18512233ddae37755d4e2acb | [
"MIT"
] | 219 | 2016-01-12T02:49:37.000Z | 2022-03-30T11:29:58.000Z | wizard.py | ubergeek42/lambda-lets-encrypt | 01e81577dabc984b18512233ddae37755d4e2acb | [
"MIT"
] | 27 | 2016-01-12T02:59:38.000Z | 2018-05-17T18:27:39.000Z | wizard.py | ubergeek42/lambda-lets-encrypt | 01e81577dabc984b18512233ddae37755d4e2acb | [
"MIT"
] | 34 | 2016-01-22T01:13:19.000Z | 2021-10-02T23:04:42.000Z | #!/usr/bin/env python
"""Lambda Lets-Encrypt Configuration/Setup Tool
This is a wizard that will help you configure the Lambda function to
automatically manage your SSL certifcates for CloudFront Distributions.
Usage:
setup.py
setup.py (-h | --help)
setup.py --version
Options:
-h --help Show this screen
... | 39.566728 | 326 | 0.64321 |
from __future__ import print_function
import json
import textwrap
import time
import zipfile
from docopt import docopt
from string import Template
from installer import sns, cloudfront, iam, s3, awslambda, elb, route53
class colors:
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
QUEST... | true | true |
f728784e949d8d6569f386295bf0297dec24e84d | 3,568 | py | Python | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/multi_variables_v1.py | globotree/tensorflow | b944fb947898de8cb4279a5a8a066955ba685412 | [
"Apache-2.0"
] | 12 | 2020-12-28T18:42:10.000Z | 2022-03-24T17:34:21.000Z | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/multi_variables_v1.py | globotree/tensorflow | b944fb947898de8cb4279a5a8a066955ba685412 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:58:11.000Z | 2022-02-10T01:47:24.000Z | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/multi_variables_v1.py | globotree/tensorflow | b944fb947898de8cb4279a5a8a066955ba685412 | [
"Apache-2.0"
] | 3 | 2020-03-09T19:17:02.000Z | 2020-06-26T23:14:31.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.976471 | 139 | 0.672085 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common_v1
def Test():
tf.compat.v1.enable_resource_var... | true | true |
f7287953922202a63a987f44cfd22e5f4bd917b7 | 66 | py | Python | lib/__init__.py | linex-cd/puf | 6da93b485b4881c12975d5af1715480a7bffc45c | [
"Apache-2.0"
] | 5 | 2018-01-02T10:27:52.000Z | 2018-05-01T16:01:01.000Z | lib/__init__.py | linex-cd/puf | 6da93b485b4881c12975d5af1715480a7bffc45c | [
"Apache-2.0"
] | null | null | null | lib/__init__.py | linex-cd/puf | 6da93b485b4881c12975d5af1715480a7bffc45c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from . import db;
from . import network;
| 16.5 | 24 | 0.590909 |
from . import db;
from . import network;
| true | true |
f7287956dcc22ab00447e566309832ba2d832ec1 | 3,309 | py | Python | env/lib/python2.7/site-packages/grpc/_plugin_wrapping.py | husky-parul/SheHacks | 19383029947f50ebaf07232c9b2ee76c75d8ada6 | [
"Apache-2.0"
] | 2 | 2018-02-01T06:30:24.000Z | 2018-04-12T15:39:56.000Z | env/lib/python2.7/site-packages/grpc/_plugin_wrapping.py | husky-parul/SheHacks | 19383029947f50ebaf07232c9b2ee76c75d8ada6 | [
"Apache-2.0"
] | null | null | null | env/lib/python2.7/site-packages/grpc/_plugin_wrapping.py | husky-parul/SheHacks | 19383029947f50ebaf07232c9b2ee76c75d8ada6 | [
"Apache-2.0"
] | null | null | null | # 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... | 33.765306 | 79 | 0.648534 |
import collections
import logging
import threading
import grpc
from grpc import _common
from grpc._cython import cygrpc
class _AuthMetadataContext(
collections.namedtuple('AuthMetadataContext', (
'service_url', 'method_name',)), grpc.AuthMetadataContext):
pass
class _CallbackS... | true | true |
f7287a635c6bc81cd38b424d6f66fce957c23b43 | 571 | py | Python | apphv/core/migrations/0031_auto_20190624_1503.py | FerneyMoreno20/Portfolio | 59eaa4f4f6762386fe84450f65f508be1414f857 | [
"bzip2-1.0.6"
] | null | null | null | apphv/core/migrations/0031_auto_20190624_1503.py | FerneyMoreno20/Portfolio | 59eaa4f4f6762386fe84450f65f508be1414f857 | [
"bzip2-1.0.6"
] | 6 | 2019-12-04T23:34:47.000Z | 2021-06-09T18:01:16.000Z | apphv/core/migrations/0031_auto_20190624_1503.py | FerneyMoreno20/Portfolio | 59eaa4f4f6762386fe84450f65f508be1414f857 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-24 15:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0030_auto_20190624_1458'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='tipom',
... | 30.052632 | 238 | 0.618214 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0030_auto_20190624_1458'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='tipom',
field=models.CharField(choices=[('Felici... | true | true |
f7287bf8ea5274c9b3d29cb36d1d4400e8ff6f01 | 14,856 | py | Python | pipe-cli/src/utilities/storage/common.py | ZMaratovna/cloud-pipeline | 542b8394f9fade8eb0ef5603568348c3f20a758d | [
"Apache-2.0"
] | 126 | 2019-03-22T19:40:38.000Z | 2022-02-16T13:01:44.000Z | pipe-cli/src/utilities/storage/common.py | ZMaratovna/cloud-pipeline | 542b8394f9fade8eb0ef5603568348c3f20a758d | [
"Apache-2.0"
] | 1,189 | 2019-03-25T10:39:27.000Z | 2022-03-31T12:50:33.000Z | pipe-cli/src/utilities/storage/common.py | ZMaratovna/cloud-pipeline | 542b8394f9fade8eb0ef5603568348c3f20a758d | [
"Apache-2.0"
] | 62 | 2019-03-22T22:09:49.000Z | 2022-03-08T12:05:56.000Z | # Copyright 2017-2020 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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... | 39.094737 | 122 | 0.655762 |
import os
import re
from abc import abstractmethod, ABCMeta
from collections import namedtuple
import click
import jwt
from src.config import Config
from src.model.data_storage_wrapper_type import WrapperType
TransferResult = namedtuple('TransferResult', ['source_key', 'destination_key', 'destination_... | true | true |
f7287cbbee5f2c74133a1acb51112b32a015c354 | 4,520 | py | Python | t5x/losses_test.py | shpotes/s4x | d14be41ea8994c36fb75801a12837c1d3e77cb57 | [
"Apache-2.0"
] | 278 | 2021-11-03T20:24:32.000Z | 2022-03-29T23:44:06.000Z | t5x/losses_test.py | justinphan3110/t5x | 83151b8a7cfc78ebfc1d87ccc5109b6a0444a5e5 | [
"Apache-2.0"
] | 31 | 2021-11-04T02:10:31.000Z | 2022-03-29T19:03:49.000Z | t5x/losses_test.py | justinphan3110/t5x | 83151b8a7cfc78ebfc1d87ccc5109b6a0444a5e5 | [
"Apache-2.0"
] | 26 | 2021-11-03T23:26:19.000Z | 2022-03-29T00:18:51.000Z | # Copyright 2022 The T5X 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 writ... | 32.992701 | 80 | 0.625885 |
from absl.testing import absltest
import jax
import jax.numpy as jnp
import numpy as np
from t5x import losses
class LossTest(absltest.TestCase):
def test_xent(self):
def lossfn(logits, targets, weights):
loss, z_loss, weight_sum = losses.compute_weighted_cross_entropy(
logits,
... | true | true |
f7287d50f20741fea305f41fd56b283240ba004b | 1,338 | py | Python | Data Analytics/Utilities/DA_tools.py | rafalmularczyk/public_lectures | fcd10c217f56021ebdec0046dfe0def7f31e9b0c | [
"CC-BY-4.0"
] | null | null | null | Data Analytics/Utilities/DA_tools.py | rafalmularczyk/public_lectures | fcd10c217f56021ebdec0046dfe0def7f31e9b0c | [
"CC-BY-4.0"
] | null | null | null | Data Analytics/Utilities/DA_tools.py | rafalmularczyk/public_lectures | fcd10c217f56021ebdec0046dfe0def7f31e9b0c | [
"CC-BY-4.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
light="#FFFCDC"
light_highlight="#FEF590"
mid="#FDED2A"
mid_highlight="#f0dc05"
dark="#EECA02"
dark_highlight="#BB9700"
green="#00FF00"
light_grey="#DDDDDD"
def is_sorted(a):
'''Check if numpy 1d-array is sorted
'''
return np.all(a[:-1] <= a[1:])
def ribb... | 33.45 | 92 | 0.650972 | import matplotlib.pyplot as plt
import numpy as np
light="#FFFCDC"
light_highlight="#FEF590"
mid="#FDED2A"
mid_highlight="#f0dc05"
dark="#EECA02"
dark_highlight="#BB9700"
green="#00FF00"
light_grey="#DDDDDD"
def is_sorted(a):
return np.all(a[:-1] <= a[1:])
def ribbon_plot(x, fx, ax=None,zorder=0):
if ax is No... | true | true |
f7287f2e4a2f658ca902bcac9869b2dbf4f7b77c | 823 | py | Python | carbon0/carbon_quiz/migrations/0040_auto_20200921_1214.py | Carbon0-Games/carbon0-web-app | 068a7223b2717d602944ec561adcde39930cba85 | [
"MIT"
] | 2 | 2020-10-30T15:07:28.000Z | 2020-12-22T04:29:50.000Z | carbon0/carbon_quiz/migrations/0040_auto_20200921_1214.py | Carbon0-Games/carbon0-web-app | 068a7223b2717d602944ec561adcde39930cba85 | [
"MIT"
] | 45 | 2020-09-22T12:47:55.000Z | 2022-03-12T00:48:18.000Z | carbon0/carbon_quiz/migrations/0040_auto_20200921_1214.py | Carbon0-Games/carbon0-web-app | 068a7223b2717d602944ec561adcde39930cba85 | [
"MIT"
] | 1 | 2020-09-08T15:48:13.000Z | 2020-09-08T15:48:13.000Z | # Generated by Django 3.1.1 on 2020-09-21 16:14
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("carbon_quiz", "0039_auto_20200921_1212"),
]
operations = [
migrations.AlterField(
model_na... | 28.37931 | 87 | 0.552855 |
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("carbon_quiz", "0039_auto_20200921_1212"),
]
operations = [
migrations.AlterField(
model_name="mission",
name="links",
... | true | true |
f7287fa1facf82d928321d46a3d03a58682dac74 | 361 | py | Python | pyservertech/auth.py | netmanchris/pyservertech | 2dad5a3e1754c22bc20042cd5df629eb38f72b06 | [
"Apache-2.0"
] | null | null | null | pyservertech/auth.py | netmanchris/pyservertech | 2dad5a3e1754c22bc20042cd5df629eb38f72b06 | [
"Apache-2.0"
] | null | null | null | pyservertech/auth.py | netmanchris/pyservertech | 2dad5a3e1754c22bc20042cd5df629eb38f72b06 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
# author: @netmanchris
# -*- coding: utf-8 -*-
"""
This module contains functions for authenticating to the ServerTech
"""
class STAuth:
def __init__(self, ipaddr, rostring, rwstring, Port="161"):
self.ipaddr = ipaddr
self.rostring = rostring
self.rws... | 22.5625 | 67 | 0.65097 |
class STAuth:
def __init__(self, ipaddr, rostring, rwstring, Port="161"):
self.ipaddr = ipaddr
self.rostring = rostring
self.rwstring = rwstring
self.port = Port | true | true |
f7287fd13c2ce1f49f02eb3a7afa4bd9d575fbea | 2,019 | py | Python | tests/test_api_status.py | max-arnold/python-block-disposable-email | 1cbfdfa9c3b3d84cb158fe079a07eb9427f97c6d | [
"BSD-3-Clause"
] | null | null | null | tests/test_api_status.py | max-arnold/python-block-disposable-email | 1cbfdfa9c3b3d84cb158fe079a07eb9427f97c6d | [
"BSD-3-Clause"
] | 6 | 2020-03-07T14:36:22.000Z | 2022-02-10T09:37:14.000Z | tests/test_api_status.py | max-arnold/python-block-disposable-email | 1cbfdfa9c3b3d84cb158fe079a07eb9427f97c6d | [
"BSD-3-Clause"
] | 1 | 2020-03-08T13:56:49.000Z | 2020-03-08T13:56:49.000Z | # -*- coding: utf-8 -*-
from bdea.client import BDEAStatusResponse
class TestBDEAStatusResponse(object):
RESPONSE = {
'apikeystatus': 'active',
'commercial_credit_status': 'exhausted',
'commercial_credit_status_percent': 0,
'credits': '0',
'credits_time': '2015-10-24 13:15... | 29.691176 | 65 | 0.563645 |
from bdea.client import BDEAStatusResponse
class TestBDEAStatusResponse(object):
RESPONSE = {
'apikeystatus': 'active',
'commercial_credit_status': 'exhausted',
'commercial_credit_status_percent': 0,
'credits': '0',
'credits_time': '2015-10-24 13:15:08',
'request_... | true | true |
f728809195d5d918917fedc3e32c19868a77fc1c | 80,708 | py | Python | tefla/core/losses.py | mkulariya1/tefla | 8de25c1b67dcf025535f5e8c40539de59acd7fb8 | [
"MIT"
] | null | null | null | tefla/core/losses.py | mkulariya1/tefla | 8de25c1b67dcf025535f5e8c40539de59acd7fb8 | [
"MIT"
] | null | null | null | tefla/core/losses.py | mkulariya1/tefla | 8de25c1b67dcf025535f5e8c40539de59acd7fb8 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------#
# Written by Mrinal Haloi
# Contact: mrinal.haloi11@gmail.com
# Copyright 2016, Mrinal Haloi
# -------------------------------------------------------------------#
import numpy as np
import tensorflow as tf
import numbers
from functools import parti... | 44.516271 | 101 | 0.681865 |
import numpy as np
import tensorflow as tf
import numbers
from functools import partial
from ..utils import util
from .layers import flatten, fully_connected as fc, relu
from .layers import gradient_reverse
from ..utils import losses_utils
log_loss = tf.losses.log_loss
def log_loss_custom(predictions, labels, eps=... | true | true |
f72880d18cdcfd38e6c5129da48d768736469e27 | 533 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractWaterBlog.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWaterBlog.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWaterBlog.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractWaterBlog(item):
'''
Parser for 'water.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', ... | 24.227273 | 104 | 0.622889 |
def extractWaterBlog(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
for tagname,... | true | true |
f7288141fdc5e6616cfe73fbefd0235cfc5b8e9c | 26,921 | py | Python | beets/ui/__init__.py | daveisadork/beets | 3d94900d7e328bcdf70575b7054438cc9cd1bba4 | [
"MIT"
] | null | null | null | beets/ui/__init__.py | daveisadork/beets | 3d94900d7e328bcdf70575b7054438cc9cd1bba4 | [
"MIT"
] | null | null | null | beets/ui/__init__.py | daveisadork/beets | 3d94900d7e328bcdf70575b7054438cc9cd1bba4 | [
"MIT"
] | null | null | null | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | 33.862893 | 77 | 0.611159 |
from __future__ import print_function
import locale
import optparse
import textwrap
import sys
from difflib import SequenceMatcher
import logging
import sqlite3
import errno
import re
import struct
import traceback
from beets import library
from beets import plugins
from beets import util
from beets.uti... | true | true |
f7288148cb9947d25dfda5b2bf1b30c0e9b02e38 | 701 | py | Python | kge/__init__.py | l6270789/TransE-Knowledge-Graph-Embedding | 1bd07c1701741c08451f28ac367c2453e21721cc | [
"MIT"
] | 73 | 2018-08-23T14:17:44.000Z | 2022-03-30T08:24:00.000Z | kge/__init__.py | Lapis-Hong/Knowledge-Graph-Embedding | 1bd07c1701741c08451f28ac367c2453e21721cc | [
"MIT"
] | 4 | 2018-10-21T03:13:08.000Z | 2020-01-10T08:42:22.000Z | kge/__init__.py | Lapis-Hong/Knowledge-Graph-Embedding | 1bd07c1701741c08451f28ac367c2453e21721cc | [
"MIT"
] | 20 | 2018-09-19T02:06:39.000Z | 2022-03-30T08:24:49.000Z | #!/usr/bin/env python
# coding: utf-8
# @Author: lapis-hong
# @Date : 2018/8/14
"""This module contains several models for Knowledge Graph Embedding
All model classes must inherit class `BaseModel` (defined in model.py)
"""
# import selected Classes into the package level so they can be convieniently imported from ... | 31.863636 | 104 | 0.760342 |
from kge.transE import TransE
from kge.distmult import DISTMULT
from kge.transH import TransH
from kge.transR import TransR
from kge.transD import TransD
from kge.stransE import STransE
__all__ = ["TransE", "DISTMULT", "TransH", "TransR", "TransE", "TransD", "STransE"]
| true | true |
f7288179eccfa4f95c2ae7406d29e6ee8e95e728 | 9,353 | py | Python | pypy3-v5.5.0-linux64/lib_pypy/_sqlite3_build.py | timm/timmnix | cd246fdea8ec4668c1ad1b30a02d6f7437e46201 | [
"MIT"
] | null | null | null | pypy3-v5.5.0-linux64/lib_pypy/_sqlite3_build.py | timm/timmnix | cd246fdea8ec4668c1ad1b30a02d6f7437e46201 | [
"MIT"
] | null | null | null | pypy3-v5.5.0-linux64/lib_pypy/_sqlite3_build.py | timm/timmnix | cd246fdea8ec4668c1ad1b30a02d6f7437e46201 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
# pysqlite2/dbapi.py: pysqlite DB-API module
#
# Copyright (C) 2007-2008 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from... | 35.029963 | 79 | 0.742008 |
import sys, os
from cffi import FFI as _FFI
_ffi = _FFI()
_ffi.cdef("""
#define SQLITE_OK ...
#define SQLITE_ERROR ...
#define SQLITE_INTERNAL ...
#define SQLITE_PERM ...
#define SQLITE_ABORT ...
#define SQLITE_BUSY ...
#define SQLITE_LOCKED ...
#define SQLITE_NOMEM ...
#define SQLITE_READONL... | true | true |
f72881b56cfdfd0a1cd37017b902f6c5a5e701b5 | 1,047 | py | Python | src/operators/test_bitwise.py | ClarkChiu/learn-python-tw | 5ee1d84437d55c052999f9edc182dad737b7fbd8 | [
"MIT"
] | 3 | 2021-12-21T03:24:53.000Z | 2022-02-07T00:58:52.000Z | src/operators/test_bitwise.py | ClarkChiu/learn-python-tw | 5ee1d84437d55c052999f9edc182dad737b7fbd8 | [
"MIT"
] | null | null | null | src/operators/test_bitwise.py | ClarkChiu/learn-python-tw | 5ee1d84437d55c052999f9edc182dad737b7fbd8 | [
"MIT"
] | null | null | null | """位元運算子
@詳見:https://www.w3schools.com/python/python_operators.asp
我們可以透過位元運算子在位元層級執行數學運算
"""
def test_bitwise_operators():
"""位元運算子"""
# 及閘(AND Gate)
# 當兩個輸入皆為 1 時,輸出才為 1
#
# 範例:
# 5 = 0b0101
# 3 = 0b0011
assert 5 & 3 == 1 # 0b0001
# 或閘(OR Gate)
# 當兩個輸入任一為 1 時,輸出為 1
#... | 17.163934 | 57 | 0.47469 |
def test_bitwise_operators():
assert 5 & 3 == 1
assert 5 | 3 == 7
assert ~5 == -6
number = 5
number ^= 3
assert 5 ^ 3 == 6
... | true | true |
f72882a4af107a0fc89d7b9667acadc487be9627 | 1,157 | py | Python | portal/__init__.py | alexarirok/county-portal | 9e17d83ea825e451bbe59c267204662f05289a25 | [
"MIT"
] | null | null | null | portal/__init__.py | alexarirok/county-portal | 9e17d83ea825e451bbe59c267204662f05289a25 | [
"MIT"
] | null | null | null | portal/__init__.py | alexarirok/county-portal | 9e17d83ea825e451bbe59c267204662f05289a25 | [
"MIT"
] | null | null | null | import os
from flask import Flask
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY = "DEVELOPMENT",
DATABASE=os.path.join(app.instance_path, "portal.sqlite3"),
)
if test_config is None:
#load instance conf... | 26.906977 | 67 | 0.654278 | import os
from flask import Flask
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY = "DEVELOPMENT",
DATABASE=os.path.join(app.instance_path, "portal.sqlite3"),
)
if test_config is None:
app.config... | true | true |
f728837796729d9ab7ed0e9f6244dfbd6431c072 | 1,884 | py | Python | utils/config.py | michaelnation26/skateboard_trick_classification | 452476f38250eafc295ba474d1eb0ec971a7cca7 | [
"MIT"
] | 6 | 2020-12-27T20:39:01.000Z | 2022-02-28T06:58:44.000Z | utils/config.py | michaelnation26/skateboard_trick_classification | 452476f38250eafc295ba474d1eb0ec971a7cca7 | [
"MIT"
] | null | null | null | utils/config.py | michaelnation26/skateboard_trick_classification | 452476f38250eafc295ba474d1eb0ec971a7cca7 | [
"MIT"
] | 2 | 2019-08-16T07:52:56.000Z | 2021-12-24T04:11:19.000Z | RGB_CLASS_NAMES = [
'kickflip',
'360_kickflip',
'50-50',
'nosegrind',
'boardslide',
'tailslide',
'fail'
]
RGB_CLASS_NAME_TO_IDX = {class_name: idx
for idx, class_name in enumerate(RGB_CLASS_NAMES)}
RGB_N_CLASSES = 7
RGB_FRAME_HEIGHT = 224
RGB_FRAME_WIDTH = 224
CHAN... | 26.914286 | 75 | 0.724522 | RGB_CLASS_NAMES = [
'kickflip',
'360_kickflip',
'50-50',
'nosegrind',
'boardslide',
'tailslide',
'fail'
]
RGB_CLASS_NAME_TO_IDX = {class_name: idx
for idx, class_name in enumerate(RGB_CLASS_NAMES)}
RGB_N_CLASSES = 7
RGB_FRAME_HEIGHT = 224
RGB_FRAME_WIDTH = 224
CHAN... | true | true |
f728857a6e0c14f66707d36a44fb12b12e721504 | 1,039 | py | Python | pydra/tasks/fsl/utils/slice.py | htwangtw/pydra-fsl | 84b18e32eb181f61780bff75240be7fa05efa637 | [
"Apache-2.0"
] | 1 | 2021-06-17T09:58:06.000Z | 2021-06-17T09:58:06.000Z | pydra/tasks/fsl/utils/slice.py | htwangtw/pydra-fsl | 84b18e32eb181f61780bff75240be7fa05efa637 | [
"Apache-2.0"
] | 16 | 2020-11-03T13:56:12.000Z | 2022-01-31T17:07:13.000Z | pydra/tasks/fsl/utils/slice.py | htwangtw/pydra-fsl | 84b18e32eb181f61780bff75240be7fa05efa637 | [
"Apache-2.0"
] | 4 | 2020-06-16T17:40:37.000Z | 2021-02-18T09:42:48.000Z | from pydra.engine import specs
from pydra import ShellCommandTask
import typing as ty
input_fields = [
(
"in_file",
specs.File,
{
"help_string": "input filename",
"argstr": "{in_file}",
"copyfile": False,
"mandatory": True,
"positi... | 23.088889 | 94 | 0.582291 | from pydra.engine import specs
from pydra import ShellCommandTask
import typing as ty
input_fields = [
(
"in_file",
specs.File,
{
"help_string": "input filename",
"argstr": "{in_file}",
"copyfile": False,
"mandatory": True,
"positi... | true | true |
f7288602befa32a9b16151fefb7ee2dd0c78f067 | 377 | py | Python | python/high-scores/high_scores.py | parkerbxyz/exercism | 2648a2654f067b0f44450ac0663ac49ee270565d | [
"MIT"
] | null | null | null | python/high-scores/high_scores.py | parkerbxyz/exercism | 2648a2654f067b0f44450ac0663ac49ee270565d | [
"MIT"
] | null | null | null | python/high-scores/high_scores.py | parkerbxyz/exercism | 2648a2654f067b0f44450ac0663ac49ee270565d | [
"MIT"
] | null | null | null | from heapq import nlargest
from typing import List
Scores = List[int]
def latest(scores: Scores) -> int:
"""The last added score."""
return scores[-1]
def personal_best(scores: Scores) -> int:
"""The highest score."""
return max(scores)
def personal_top_three(scores: Scores) -> Scores:
"""The... | 18.85 | 49 | 0.668435 | from heapq import nlargest
from typing import List
Scores = List[int]
def latest(scores: Scores) -> int:
return scores[-1]
def personal_best(scores: Scores) -> int:
return max(scores)
def personal_top_three(scores: Scores) -> Scores:
return nlargest(3, scores)
| true | true |
f72886901723e0cfbb1b95af1f0b53bf4c3d3541 | 9,730 | py | Python | setup.py | skyw/NeMo | c51685e03f52d3428d19b7edccc1bbd0da5d8edb | [
"Apache-2.0"
] | 1 | 2021-06-19T19:27:19.000Z | 2021-06-19T19:27:19.000Z | setup.py | AbdullahMu/NeMo | 3886aa251f7be7c2e43aeb7315afc6b8924228aa | [
"Apache-2.0"
] | null | null | null | setup.py | AbdullahMu/NeMo | 3886aa251f7be7c2e43aeb7315afc6b8924228aa | [
"Apache-2.0"
] | null | null | null | # ! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2020, 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 copy of the License at
#
# http://www.apache.org/lice... | 33.902439 | 107 | 0.633505 |
import codecs
import os
import subprocess
import sys
from distutils import cmd as distutils_cmd
from distutils import log as distutils_log
from itertools import chain
import setuptools
def is_build_action():
if len(sys.argv) <= 1:
return False
BUILD_TOKENS = ["egg_info", "dist", "b... | true | true |
f72888e274e6c29826609f05c71de716386bfb11 | 233 | py | Python | tenth/tenth/apps/gathering/serializers.py | TanDeemo/Tenth | 52f721d4433edfa336e989e6eeedd288d4e38674 | [
"MIT"
] | null | null | null | tenth/tenth/apps/gathering/serializers.py | TanDeemo/Tenth | 52f721d4433edfa336e989e6eeedd288d4e38674 | [
"MIT"
] | null | null | null | tenth/tenth/apps/gathering/serializers.py | TanDeemo/Tenth | 52f721d4433edfa336e989e6eeedd288d4e38674 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from gathering.models import Gathering
class GatheringSerializer(serializers.ModelSerializer):
"""活动序列化器"""
class Meta:
model = Gathering
fields = '__all__'
| 21.181818 | 56 | 0.690987 | from rest_framework import serializers
from gathering.models import Gathering
class GatheringSerializer(serializers.ModelSerializer):
class Meta:
model = Gathering
fields = '__all__'
| true | true |
f72888e863e4c1d7f5e86f2635a47aaa2c4221cf | 332 | py | Python | src/graph_generator/typeparsing/__init__.py | carolemieux/typilus-action | 0e8627cf6db38d2ec153b927ae82c156a865b64f | [
"MIT"
] | 41 | 2020-05-18T21:00:44.000Z | 2022-01-26T23:06:58.000Z | src/graph_generator/typeparsing/__init__.py | carolemieux/typilus-action | 0e8627cf6db38d2ec153b927ae82c156a865b64f | [
"MIT"
] | 7 | 2020-05-18T10:07:12.000Z | 2021-09-28T12:17:37.000Z | src/graph_generator/typeparsing/__init__.py | carolemieux/typilus-action | 0e8627cf6db38d2ec153b927ae82c156a865b64f | [
"MIT"
] | 2 | 2020-06-10T11:15:04.000Z | 2020-06-20T11:17:48.000Z | from .visitor import TypeAnnotationVisitor
from .nodes import *
from .aliasreplacement import AliasReplacementVisitor
from .erasure import EraseOnceTypeRemoval
from .inheritancerewrite import DirectInheritanceRewriting
from .pruneannotations import PruneAnnotationVisitor
from .rewriterulevisitor import RewriteR... | 36.888889 | 59 | 0.864458 | from .visitor import TypeAnnotationVisitor
from .nodes import *
from .aliasreplacement import AliasReplacementVisitor
from .erasure import EraseOnceTypeRemoval
from .inheritancerewrite import DirectInheritanceRewriting
from .pruneannotations import PruneAnnotationVisitor
from .rewriterulevisitor import RewriteR... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.