max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
pdiffcopy/hashing.py | xolox/python-pdiffcopy | 5 | 6100 | # Fast large file synchronization inspired by rsync.
#
# Author: <NAME> <<EMAIL>>
# Last Change: March 6, 2020
# URL: https://pdiffcopy.readthedocs.io
"""Parallel hashing of files using :mod:`multiprocessing` and :mod:`pdiffcopy.mp`."""
# Standard library modules.
import functools
import hashlib
import os
# External... | # Fast large file synchronization inspired by rsync.
#
# Author: <NAME> <<EMAIL>>
# Last Change: March 6, 2020
# URL: https://pdiffcopy.readthedocs.io
"""Parallel hashing of files using :mod:`multiprocessing` and :mod:`pdiffcopy.mp`."""
# Standard library modules.
import functools
import hashlib
import os
# External... | en | 0.74486 | # Fast large file synchronization inspired by rsync. # # Author: <NAME> <<EMAIL>> # Last Change: March 6, 2020 # URL: https://pdiffcopy.readthedocs.io Parallel hashing of files using :mod:`multiprocessing` and :mod:`pdiffcopy.mp`. # Standard library modules. # External dependencies. # Modules included in our package. #... | 2.668458 | 3 |
pyscf/nao/test/test_0003_na2_nao.py | robert-anderson/pyscf | 3 | 6101 | <filename>pyscf/nao/test/test_0003_na2_nao.py
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | <filename>pyscf/nao/test/test_0003_na2_nao.py
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | en | 0.679019 | # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl... | 2.011992 | 2 |
tests/moz_library/rental_books_test.py | mozkzki/moz-library | 0 | 6102 | import pytest
from moz_library.rental_books import RentalBooks
class TestRentalBooks:
@pytest.fixture()
def books1(self):
return RentalBooks()
def test_can_extend_period_1(self, books1):
assert books1._can_extend_period("延長できません") is False
def test_can_extend_period_2(self, books1):
... | import pytest
from moz_library.rental_books import RentalBooks
class TestRentalBooks:
@pytest.fixture()
def books1(self):
return RentalBooks()
def test_can_extend_period_1(self, books1):
assert books1._can_extend_period("延長できません") is False
def test_can_extend_period_2(self, books1):
... | none | 1 | 2.655607 | 3 | |
examples/src/Charts/MultiCategoryChart.py | aspose-slides/Aspose.Slides-for-Python-via-.NET | 0 | 6103 | <gh_stars>0
import aspose.pydrawing as drawing
import aspose.slides as slides
def charts_multi_category_chart():
#ExStart:MultiCategoryChart
# The path to the documents directory.
outDir = "./examples/out/"
with slides.Presentation() as pres:
slide = pres.slides[0]
ch = pres.slides[0... | import aspose.pydrawing as drawing
import aspose.slides as slides
def charts_multi_category_chart():
#ExStart:MultiCategoryChart
# The path to the documents directory.
outDir = "./examples/out/"
with slides.Presentation() as pres:
slide = pres.slides[0]
ch = pres.slides[0].shapes.add... | en | 0.621542 | #ExStart:MultiCategoryChart # The path to the documents directory. # Adding Series # Save presentation with chart #ExEnd:MultiCategoryChart | 2.780776 | 3 |
netbox/extras/forms/filtersets.py | cybarox/netbox | 0 | 6104 | <reponame>cybarox/netbox<gh_stars>0
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext as _
from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup
from extras.choices imp... | from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext as _
from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup
from extras.choices import *
from extras.models import *
fr... | none | 1 | 1.862019 | 2 | |
bin/write2cly.py | docdiesel/smartmetertools | 1 | 6105 | #!/usr/bin/python3
## write2cly.py - reads json (generated by sml_reader.py) from stdin
## - writes values to Corlysis time series InfluxDB
##
## Writes data from smart meter to time series database (InfluxDB)
## at Corlysis.com [1]. You need to configure your database and token
## in the config secti... | #!/usr/bin/python3
## write2cly.py - reads json (generated by sml_reader.py) from stdin
## - writes values to Corlysis time series InfluxDB
##
## Writes data from smart meter to time series database (InfluxDB)
## at Corlysis.com [1]. You need to configure your database and token
## in the config secti... | en | 0.643595 | #!/usr/bin/python3 ## write2cly.py - reads json (generated by sml_reader.py) from stdin ## - writes values to Corlysis time series InfluxDB ## ## Writes data from smart meter to time series database (InfluxDB) ## at Corlysis.com [1]. You need to configure your database and token ## in the config sectio... | 2.662955 | 3 |
dns/rdtypes/ANY/__init__.py | Ashiq5/dnspython | 0 | 6106 | <reponame>Ashiq5/dnspython
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the ... | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... | en | 0.631673 | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and t... | 1.408342 | 1 |
01_test.py | KhubbatulinMark/DCase2020-Task-2-on-Wigner-Ville-transform | 3 | 6107 | <gh_stars>1-10
"""
@file 01_test.py
@brief Script for test
@author <NAME>, <NAME>, and <NAME> (Hitachi Ltd.)
Copyright (C) 2020 Hitachi, Ltd. All right reserved.
"""
########################################################################
# import default python-library
#########################################... | """
@file 01_test.py
@brief Script for test
@author <NAME>, <NAME>, and <NAME> (Hitachi Ltd.)
Copyright (C) 2020 Hitachi, Ltd. All right reserved.
"""
########################################################################
# import default python-library
########################################################... | de | 0.334738 | @file 01_test.py @brief Script for test @author <NAME>, <NAME>, and <NAME> (Hitachi Ltd.) Copyright (C) 2020 Hitachi, Ltd. All right reserved. ######################################################################## # import default python-library ##################################################################... | 2.262156 | 2 |
src/text_split/split.py | i1123581321/word_split | 0 | 6108 | <reponame>i1123581321/word_split
import argparse
import os
parser = argparse.ArgumentParser(description="a simple parser")
parser.add_argument("filename", type=str)
parser.add_argument("lineno", nargs="+", type=int)
parser.add_argument("--same_length", action=argparse.BooleanOptionalAction)
def main():
args = p... | import argparse
import os
parser = argparse.ArgumentParser(description="a simple parser")
parser.add_argument("filename", type=str)
parser.add_argument("lineno", nargs="+", type=int)
parser.add_argument("--same_length", action=argparse.BooleanOptionalAction)
def main():
args = parser.parse_args()
filename =... | none | 1 | 3.23756 | 3 | |
src/sentry/models/event.py | Ali-Tahir/sentry | 0 | 6109 | <reponame>Ali-Tahir/sentry
from __future__ import absolute_import
import six
import string
import warnings
import pytz
from collections import OrderedDict
from dateutil.parser import parse as parse_date
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy a... | from __future__ import absolute_import
import six
import string
import warnings
import pytz
from collections import OrderedDict
from dateutil.parser import parse as parse_date
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from hashlib import md5... | en | 0.880349 | Creating an instance of this dictionary will send the event through basic (Rust-based) type/schema validation called "re-normalization". This is used as a wrapper type for `Event.data` such that creating an event object (or loading it from the DB) will ensure the data fits the type schema. Methods and ... | 2.021635 | 2 |
Assignment3/src/data/make_nowcast_dataset.py | shikashyam/BigDataSystemsCoursework | 0 | 6110 | <gh_stars>0
"""
Makes training and test dataset for nowcasting model using SEVIR
"""
# -*- coding: utf-8 -*-
import argparse
import logging
import os
import h5py
os.environ["HDF5_USE_FILE_LOCKING"]='FALSE'
import sys
import numpy as np
import tensorflow as tf
from nowcast_generator import get_nowcast_test_generator
... | """
Makes training and test dataset for nowcasting model using SEVIR
"""
# -*- coding: utf-8 -*-
import argparse
import logging
import os
import h5py
os.environ["HDF5_USE_FILE_LOCKING"]='FALSE'
import sys
import numpy as np
import tensorflow as tf
from nowcast_generator import get_nowcast_test_generator
# parser = ... | en | 0.248723 | Makes training and test dataset for nowcasting model using SEVIR # -*- coding: utf-8 -*- # parser = argparse.ArgumentParser(description='Make nowcast training & test datasets using SEVIR') # parser.add_argument('--sevir_data', type=str, help='location of SEVIR dataset',default='../../data/sevir') # parser.add_argument(... | 2.316823 | 2 |
blender-plugin/import_cast.py | rtasan/ApexCastImporter | 0 | 6111 | <filename>blender-plugin/import_cast.py
# The Original importer was created by Nick
# Copyright (c) 2020 Nick
import bpy
import bmesh
import os
import array
import math
from mathutils import *
from bpy_extras.image_utils import load_image
from .cast import Cast, Model, Animation, Curve, NotificationTrack, Mesh, Skele... | <filename>blender-plugin/import_cast.py
# The Original importer was created by Nick
# Copyright (c) 2020 Nick
import bpy
import bmesh
import os
import array
import math
from mathutils import *
from bpy_extras.image_utils import load_image
from .cast import Cast, Model, Animation, Curve, NotificationTrack, Mesh, Skele... | en | 0.597953 | # The Original importer was created by Nick # Copyright (c) 2020 Nick # グループシェーダーを作成 #テクスチャを定義 # Loop and connect the slots #画像ノードを作成 #画像を読み込み # texture.outputのカラーとinputをつなげる(link) # I am sorry but blender sucks # Also sucks, WXYZ? => XYZW master race # If you already created the material, ignore this # Blender really ... | 2.004524 | 2 |
study/migrations/0003_auto_20200224_2316.py | hpathipati/Quick-Tutor | 0 | 6112 | <gh_stars>0
# Generated by Django 3.0.2 on 2020-02-24 23:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('study', '0002_student'),
]
operations = [
migrations.AlterField(
model_name='student',
name='bio',
... | # Generated by Django 3.0.2 on 2020-02-24 23:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('study', '0002_student'),
]
operations = [
migrations.AlterField(
model_name='student',
name='bio',
field... | en | 0.860115 | # Generated by Django 3.0.2 on 2020-02-24 23:16 | 1.581813 | 2 |
tests/unit/resources/test_resource.py | gzecchi/oneview-python | 0 | 6113 | <reponame>gzecchi/oneview-python<filename>tests/unit/resources/test_resource.py
# -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | en | 0.85916 | # -*- coding: utf-8 -*- ### # (C) Copyright [2019] Hewlett Packard Enterprise Development LP # # 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 #... | 1.950237 | 2 |
workalendar/usa/colorado.py | vanadium23/workalendar | 0 | 6114 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .core import UnitedStates
class Colorado(UnitedStates):
"""Colorado"""
# Colorado has only federal state holidays.
# NOTE: <NAME> is an optional holiday
| # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .core import UnitedStates
class Colorado(UnitedStates):
"""Colorado"""
# Colorado has only federal state holidays.
# NOTE: <NAME> is an optional holiday
| en | 0.842862 | # -*- coding: utf-8 -*- Colorado # Colorado has only federal state holidays. # NOTE: <NAME> is an optional holiday | 1.74825 | 2 |
dataloaders/augmentation.py | thierrypin/gei-pool | 0 | 6115 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import numpy as np
# Generic data augmentation
class Augmenter:
""" Generic data augmentation class with chained operations
"""
def __init__(self, ops=[]):
if not isinstance(ops, list):
print("Error: ops must be a list of fu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import numpy as np
# Generic data augmentation
class Augmenter:
""" Generic data augmentation class with chained operations
"""
def __init__(self, ops=[]):
if not isinstance(ops, list):
print("Error: ops must be a list of fu... | en | 0.370354 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Generic data augmentation Generic data augmentation class with chained operations ########## # Images # ########## Default data augmentation with horizontal flip, vertical flip, gaussian noise, black hstripe, and black vstripe. Returns: Augmenter object. ... | 3.0533 | 3 |
cigeo/admin.py | CzechInvest/ciis | 1 | 6116 | <reponame>CzechInvest/ciis
from django.contrib import admin
from django.contrib.gis import geos
from leaflet.admin import LeafletGeoAdmin, LeafletGeoAdminMixin
from .models import Lau1
from .models import Nuts3
from .models import Airport
from .models import Road
from .models import PublicTransportStop
from .models imp... | from django.contrib import admin
from django.contrib.gis import geos
from leaflet.admin import LeafletGeoAdmin, LeafletGeoAdminMixin
from .models import Lau1
from .models import Nuts3
from .models import Airport
from .models import Road
from .models import PublicTransportStop
from .models import RailwayStation
from dja... | en | 0.577591 | #readonly_fields = ("code", "name",) #readonly_fields = ("code", "name",) #readonly_fields = ("code", "name",) #readonly_fields = ("code", "name",) #readonly_fields = ("code", "name",) #readonly_fields = ("code", "name",) Filter for admin interface of NUTS3 regions (Kraje) #' Add NUTS3 (by name) search and area size se... | 1.966594 | 2 |
umbra/monitor/main.py | RafaelAPB/umbra | 0 | 6117 | import logging
import json
import asyncio
from google.protobuf import json_format
from umbra.common.protobuf.umbra_grpc import MonitorBase
from umbra.common.protobuf.umbra_pb2 import Instruction, Snapshot
from umbra.monitor.tools import Tools
logger = logging.getLogger(__name__)
logging.getLogger("hpack").setLevel(... | import logging
import json
import asyncio
from google.protobuf import json_format
from umbra.common.protobuf.umbra_grpc import MonitorBase
from umbra.common.protobuf.umbra_pb2 import Instruction, Snapshot
from umbra.monitor.tools import Tools
logger = logging.getLogger(__name__)
logging.getLogger("hpack").setLevel(... | none | 1 | 1.964778 | 2 | |
pycs/spells/hunters_mark.py | dwagon/pycs | 0 | 6118 | <filename>pycs/spells/hunters_mark.py
"""https://www.dndbeyond.com/spells/hunters-mark"""
from unittest.mock import patch
import dice
from pycs.constant import ActionCategory
from pycs.constant import SpellType
from pycs.creature import Creature
from pycs.effect import Effect
from pycs.gear import Shortbow
from pycs.s... | <filename>pycs/spells/hunters_mark.py
"""https://www.dndbeyond.com/spells/hunters-mark"""
from unittest.mock import patch
import dice
from pycs.constant import ActionCategory
from pycs.constant import SpellType
from pycs.creature import Creature
from pycs.effect import Effect
from pycs.gear import Shortbow
from pycs.s... | de | 0.649444 | https://www.dndbeyond.com/spells/hunters-mark ############################################################################## ############################################################################## ############################################################################## You choose a creature you can see wit... | 2.548877 | 3 |
utilities.py | armandok/pySLAM-D | 10 | 6119 | import numpy as np
def rot_to_angle(rot):
return np.arccos(0.5*np.trace(rot)-0.5)
def rot_to_heading(rot):
# This function calculates the heading angle of the rot matrix w.r.t. the y-axis
new_rot = rot[0:3:2, 0:3:2] # remove the mid row and column corresponding to the y-axis
new_rot = new_rot/np.li... | import numpy as np
def rot_to_angle(rot):
return np.arccos(0.5*np.trace(rot)-0.5)
def rot_to_heading(rot):
# This function calculates the heading angle of the rot matrix w.r.t. the y-axis
new_rot = rot[0:3:2, 0:3:2] # remove the mid row and column corresponding to the y-axis
new_rot = new_rot/np.li... | en | 0.531942 | # This function calculates the heading angle of the rot matrix w.r.t. the y-axis # remove the mid row and column corresponding to the y-axis | 3.152555 | 3 |
robosuite/models/grippers/__init__.py | kyungjaelee/robosuite | 397 | 6120 | <reponame>kyungjaelee/robosuite<gh_stars>100-1000
from .gripper_model import GripperModel
from .gripper_factory import gripper_factory
from .gripper_tester import GripperTester
from .panda_gripper import PandaGripper
from .rethink_gripper import RethinkGripper
from .robotiq_85_gripper import Robotiq85Gripper
from .rob... | from .gripper_model import GripperModel
from .gripper_factory import gripper_factory
from .gripper_tester import GripperTester
from .panda_gripper import PandaGripper
from .rethink_gripper import RethinkGripper
from .robotiq_85_gripper import Robotiq85Gripper
from .robotiq_three_finger_gripper import RobotiqThreeFinge... | none | 1 | 1.742168 | 2 | |
src/pose/visualizations/visualizations.py | Idein/chainer-hand-pose | 11 | 6121 | import logging
logger = logging.getLogger(__name__)
import random
import chainercv
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # NOQA
from pose.hand_dataset.geometry_utils import normalize_joint_zyx
from pose.hand_dataset.image_utils import normalize_depth
# Dec... | import logging
logger = logging.getLogger(__name__)
import random
import chainercv
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # NOQA
from pose.hand_dataset.geometry_utils import normalize_joint_zyx
from pose.hand_dataset.image_utils import normalize_depth
# Dec... | en | 0.785895 | # NOQA # Decimal Code (R,G,B) extend chainercv.visualizations.vis_image # remove channnel dimension Visualize points in an image, customized to our purpose. Base implementation is taken from chainercv.visualizations.vis_image # note that the shape of `point[i]` is (K,N) and the format of one is (y, x), (z,y,x). # (... | 2.239583 | 2 |
publication-erdf/flask_service.py | ticapix/automated-tasks | 0 | 6122 | <reponame>ticapix/automated-tasks<gh_stars>0
#!/usr/bin/env python3
from flask import Flask
app = Flask(__name__)
@app.route('/process-email')
def process_email():
return "Hello World!"
if __name__ == "__main__":
app.run()
| #!/usr/bin/env python3
from flask import Flask
app = Flask(__name__)
@app.route('/process-email')
def process_email():
return "Hello World!"
if __name__ == "__main__":
app.run() | fr | 0.221828 | #!/usr/bin/env python3 | 2.40798 | 2 |
tools/nn/speaker.py | mikiec84/speaking_detection | 0 | 6123 | import os
import skimage.io
from torch.nn import Module
import torch.nn
from torchvision.models import resnet18
from nn.speaker_dataset import Dataset # @UnusedImport
os.environ['TORCH_MODEL_ZOO'] = '../data/'
VIDTIMIT_PATH = '../data/vidtimit/'
skimage.io.use_plugin('pil')
class Net(Module):
def __init__(s... | import os
import skimage.io
from torch.nn import Module
import torch.nn
from torchvision.models import resnet18
from nn.speaker_dataset import Dataset # @UnusedImport
os.environ['TORCH_MODEL_ZOO'] = '../data/'
VIDTIMIT_PATH = '../data/vidtimit/'
skimage.io.use_plugin('pil')
class Net(Module):
def __init__(s... | ru | 0.094452 | # @UnusedImport # print(len(list(self.features.parameters()))) # X = F.softmax(self.basenet(X)) | 2.433476 | 2 |
tensorflow_model_analysis/util_test.py | mdreves/model-analysis | 0 | 6124 | <reponame>mdreves/model-analysis
# Copyright 2018 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 applica... | # Copyright 2018 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, ... | en | 0.813491 | # Copyright 2018 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, ... | 2.173562 | 2 |
laia/data/transforms/vision/random_beta_morphology.py | eivtho/PyLaia | 89 | 6125 | from typing import List, Tuple, Union
import numpy as np
import scipy.special
from PIL import Image, ImageFilter
class RandomBetaMorphology:
def __init__(
self, filter_size_min: int, filter_size_max: int, alpha: float, beta: float
) -> None:
assert filter_size_min % 2 != 0, "Filter size must ... | from typing import List, Tuple, Union
import numpy as np
import scipy.special
from PIL import Image, ImageFilter
class RandomBetaMorphology:
def __init__(
self, filter_size_min: int, filter_size_max: int, alpha: float, beta: float
) -> None:
assert filter_size_min % 2 != 0, "Filter size must ... | none | 1 | 2.558273 | 3 | |
hemp/internal/utils.py | Addvilz/hemp | 1 | 6126 | <gh_stars>1-10
import sys
from fabric.utils import error, puts
from git import RemoteProgress
def print_err(message, func=None, exception=None, stdout=None, stderr=None):
error('[Hemp] ' + message, func, exception, stdout, stderr)
def print_info(text, show_prefix=None, end="\n", flush=True):
puts('[Hemp] '... | import sys
from fabric.utils import error, puts
from git import RemoteProgress
def print_err(message, func=None, exception=None, stdout=None, stderr=None):
error('[Hemp] ' + message, func, exception, stdout, stderr)
def print_info(text, show_prefix=None, end="\n", flush=True):
puts('[Hemp] ' + text, show_p... | none | 1 | 2.5857 | 3 | |
backend/links/sentence.py | dla1635/hyLink | 1 | 6127 | <reponame>dla1635/hyLink<gh_stars>1-10
# -*- coding: utf-8 -*-
from collections import Counter
from konlpy.tag import Okt
class Sentence(object):
okt = Okt()
def __init__(self, text, index=0):
self.index = index
self.text = text.strip()
self.tokens = self.okt.phrases(self.text)
... | # -*- coding: utf-8 -*-
from collections import Counter
from konlpy.tag import Okt
class Sentence(object):
okt = Okt()
def __init__(self, text, index=0):
self.index = index
self.text = text.strip()
self.tokens = self.okt.phrases(self.text)
self.bow = Counter(self.tokens)
... | en | 0.769321 | # -*- coding: utf-8 -*- | 3.109813 | 3 |
tests/arch/x86/test_x86parser.py | IMULMUL/barf-project | 1,395 | 6128 | # Copyright (c) 2014, Fundacion Dr. <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and... | # Copyright (c) 2014, Fundacion Dr. <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and... | en | 0.6569 | # Copyright (c) 2014, Fundacion Dr. <NAME> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and t... | 1.697029 | 2 |
Concurrency/codeSample/Part4_Thread_Synchronuzation_Primitives/sema_signal.py | Chyi341152/pyConPaper | 1 | 6129 | <reponame>Chyi341152/pyConPaper
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# sema_signal.py
#
# An example of using a semaphore for signaling between threads
import threading
import time
done = threading.Semaphore(0) # Resource control.
item = None
def producer():
global item
print("I'm the pro... | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# sema_signal.py
#
# An example of using a semaphore for signaling between threads
import threading
import time
done = threading.Semaphore(0) # Resource control.
item = None
def producer():
global item
print("I'm the producer and I produce data.")
... | en | 0.8107 | #!/usr/bin/env python3 # -*- coding:utf-8 -*- # sema_signal.py # # An example of using a semaphore for signaling between threads # Resource control. # Increments the count and signals waiting threads # Waits for the count is 0, otherwise decrements the count and continues Semaphore Uses: 1. Resource control ... | 4.667023 | 5 |
temp_wc_analysis/analysis.py | KarrLab/wc_sim | 8 | 6130 | '''Analysis utility functions.
:Author: <NAME> <<EMAIL>>
:Date: 2016-03-26
:Copyright: 2016-2018, Karr Lab
:License: MIT
'''
# TODO(Arthur): IMPORTANT: refactor and replace
from matplotlib import pyplot
from matplotlib import ticker
from wc_lang import Model, Submodel
from scipy.constants import Avogadro
import nump... | '''Analysis utility functions.
:Author: <NAME> <<EMAIL>>
:Date: 2016-03-26
:Copyright: 2016-2018, Karr Lab
:License: MIT
'''
# TODO(Arthur): IMPORTANT: refactor and replace
from matplotlib import pyplot
from matplotlib import ticker
from wc_lang import Model, Submodel
from scipy.constants import Avogadro
import nump... | en | 0.600493 | Analysis utility functions. :Author: <NAME> <<EMAIL>> :Date: 2016-03-26 :Copyright: 2016-2018, Karr Lab :License: MIT # TODO(Arthur): IMPORTANT: refactor and replace #convert time to hours #create figure #extract data to plot #extract data #scale #plot results #update range #add to plot #set axis limits #add axis labe... | 2.175305 | 2 |
setup.py | bstuddard/bonsai | 26 | 6131 | <gh_stars>10-100
from setuptools import setup, find_packages
with open("README.md", "r") as readme_file:
readme = readme_file.read()
requirements = [
'xgboost>=0.90',
'catboost>=0.26',
'bayesian-optimization>=1.2.0',
'numpy>=1.19.5',
'pandas>=1.1.5',
'matplotlib>=3.2.2',
'seaborn>=0.11... | from setuptools import setup, find_packages
with open("README.md", "r") as readme_file:
readme = readme_file.read()
requirements = [
'xgboost>=0.90',
'catboost>=0.26',
'bayesian-optimization>=1.2.0',
'numpy>=1.19.5',
'pandas>=1.1.5',
'matplotlib>=3.2.2',
'seaborn>=0.11.1',
'plotly>... | none | 1 | 1.338928 | 1 | |
_scripts/increment_version.py | clockhart/pathogen | 0 | 6132 | <gh_stars>0
"""
increment_version.py
written in Python3
author: <NAME> <<EMAIL>>
"""
import yaml
# Read in version
with open('version.yml', 'r') as f:
version = yaml.safe_load(f.read())
# Strip "dev" out of micro
version['micro'] = int(str(version['micro']).replace('dev', ''))
# Update patch
version['micro'] +... | """
increment_version.py
written in Python3
author: <NAME> <<EMAIL>>
"""
import yaml
# Read in version
with open('version.yml', 'r') as f:
version = yaml.safe_load(f.read())
# Strip "dev" out of micro
version['micro'] = int(str(version['micro']).replace('dev', ''))
# Update patch
version['micro'] += 1
# Add "... | en | 0.693344 | increment_version.py written in Python3 author: <NAME> <<EMAIL>> # Read in version # Strip "dev" out of micro # Update patch # Add "dev" back to patch # Output version # Transform version dict to string # Write version string to pathogen/_version.py # Return | 2.51932 | 3 |
holoviews/core/data/ibis.py | TheoMathurin/holoviews | 1 | 6133 | <gh_stars>1-10
import sys
import numpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
from .. import util
from ..element import Element
from ..ndmapping import NdMapping, item_check, sorted_context
from .interface import Interface
from . import pandas
from .util... | import sys
import numpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
from .. import util
from ..element import Element
from ..ndmapping import NdMapping, item_check, sorted_context
from .interface import Interface
from . import pandas
from .util import cached
... | en | 0.865196 | # the rowid is needed until ibis updates versions # Get the length by counting the length of an empty query. # Make an empty query to see if a row is returned. # We should use a pseudo column for the row number but i think that is still awaiting # a pr on ibis Given a dataset object and data in the appropriate format f... | 2.0379 | 2 |
chess/models/tournament.py | S0Imyr/Projet-4 | 0 | 6134 | # -*- coding: utf-8 -*-
"""
Handles the tournament logic
"""
import datetime
from chess.utils.utils import get_new_id
from chess.models.actors import Player
from chess.models.round import Round
TOURNAMENT_ID_WIDTH = 8
NB_ROUND = 4
NB_PLAYERS = 8
NB_MATCH = 4
class Tournament:
""" The class Tournament is t... | # -*- coding: utf-8 -*-
"""
Handles the tournament logic
"""
import datetime
from chess.utils.utils import get_new_id
from chess.models.actors import Player
from chess.models.round import Round
TOURNAMENT_ID_WIDTH = 8
NB_ROUND = 4
NB_PLAYERS = 8
NB_MATCH = 4
class Tournament:
""" The class Tournament is t... | en | 0.863144 | # -*- coding: utf-8 -*- Handles the tournament logic The class Tournament is the central piece of the models. Defines the list of identifier of the players who join the tournament. :param actors: :return: None Launches the round number "num_round". :param num_round: number of the round played ... | 3.192447 | 3 |
set-config.py | astubenazy/vrops-metric-collection | 2 | 6135 | # !/usr/bin python
"""
#
# set-config - a small python program to setup the configuration environment for data-collect.py
# data-collect.py contain the python program to gather Metrics from vROps
# Author <NAME> <<EMAIL>>
#
"""
# Importing the required modules
import json
import base64
import os,sys
# Getting the ... | # !/usr/bin python
"""
#
# set-config - a small python program to setup the configuration environment for data-collect.py
# data-collect.py contain the python program to gather Metrics from vROps
# Author <NAME> <<EMAIL>>
#
"""
# Importing the required modules
import json
import base64
import os,sys
# Getting the ... | en | 0.725605 | # !/usr/bin python # # set-config - a small python program to setup the configuration environment for data-collect.py # data-collect.py contain the python program to gather Metrics from vROps # Author <NAME> <<EMAIL>> # # Importing the required modules # Getting the absolute path from where the script is being run # G... | 2.597217 | 3 |
tests/test_app.py | inmanta/inmanta-core | 6 | 6136 | <reponame>inmanta/inmanta-core
"""
Copyright 2018 Inmanta
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 ... | """
Copyright 2018 Inmanta
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 ... | en | 0.783093 | Copyright 2018 Inmanta 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,... | 1.352528 | 1 |
AtC_Beg_Con_021-030/ABC027/C.py | yosho-18/AtCoder | 0 | 6137 | n = int(input())
row = 0
for i in range(100):
if 2 ** i <= n <= 2 ** (i + 1) - 1:
row = i
break
def seki(k, n):
for _ in range(n):
k = 4 * k + 2
return k
k = 0
if row % 2 != 0:
k = 2
cri = seki(k, row // 2)
if n < cri:
print("Aoki")
else:
print("Ta... | n = int(input())
row = 0
for i in range(100):
if 2 ** i <= n <= 2 ** (i + 1) - 1:
row = i
break
def seki(k, n):
for _ in range(n):
k = 4 * k + 2
return k
k = 0
if row % 2 != 0:
k = 2
cri = seki(k, row // 2)
if n < cri:
print("Aoki")
else:
print("Ta... | none | 1 | 3.066303 | 3 | |
extplugins/codvote.py | Desi-Boyz/cod4x-server-B3-configs | 1 | 6138 | # CoDVote plugin for BigBrotherBot(B3) (www.bigbrotherbot.net)
# Copyright (C) 2015 ph03n1x
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... | # CoDVote plugin for BigBrotherBot(B3) (www.bigbrotherbot.net)
# Copyright (C) 2015 ph03n1x
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... | en | 0.85767 | # CoDVote plugin for BigBrotherBot(B3) (www.bigbrotherbot.net) # Copyright (C) 2015 ph03n1x # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio... | 2.015536 | 2 |
utils.py | bianan/cfl | 4 | 6139 | <gh_stars>1-10
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | # Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | en | 0.79371 | # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,... | 1.991587 | 2 |
unittest/scripts/py_devapi/scripts/mysqlx_collection_remove.py | mueller/mysql-shell | 119 | 6140 | # Assumptions: validate_crud_functions available
# Assumes __uripwd is defined as <user>:<pwd>@<host>:<plugin_port>
from __future__ import print_function
from mysqlsh import mysqlx
mySession = mysqlx.get_session(__uripwd)
ensure_schema_does_not_exist(mySession, 'js_shell_test')
schema = mySession.create_schema('js_s... | # Assumptions: validate_crud_functions available
# Assumes __uripwd is defined as <user>:<pwd>@<host>:<plugin_port>
from __future__ import print_function
from mysqlsh import mysqlx
mySession = mysqlx.get_session(__uripwd)
ensure_schema_does_not_exist(mySession, 'js_shell_test')
schema = mySession.create_schema('js_s... | en | 0.516042 | # Assumptions: validate_crud_functions available # Assumes __uripwd is defined as <user>:<pwd>@<host>:<plugin_port> # Creates a test collection and inserts data into it # ------------------------------------------------ # collection.remove Unit Testing: Dynamic Behavior # -----------------------------------------------... | 2.16975 | 2 |
indian-flag.py | aditya270520/indian-flag | 0 | 6141 | <gh_stars>0
import turtle
turtle.bgcolor('black')
wn=turtle.Screen()
tr=turtle.Turtle()
move=1
tr.speed("fastest")
for i in range (360):
tr.write("ADITYA",'false','center',font=('Showcard gothic',50))
tr.penup()
tr.goto(-200,100)
tr.pendown()
tr.color("orange")
tr.right(move)
tr.forward... | import turtle
turtle.bgcolor('black')
wn=turtle.Screen()
tr=turtle.Turtle()
move=1
tr.speed("fastest")
for i in range (360):
tr.write("ADITYA",'false','center',font=('Showcard gothic',50))
tr.penup()
tr.goto(-200,100)
tr.pendown()
tr.color("orange")
tr.right(move)
tr.forward(100)
tr... | none | 1 | 3.395169 | 3 | |
leaf/rbac/model/__init__.py | guiqiqi/leaf | 119 | 6142 | """用户, 组, 及相关认证数据库模型"""
from .group import Group
from .user import User
from .user import UserIndex
from .auth import Authentication
from .accesspoint import AccessPoint
| """用户, 组, 及相关认证数据库模型"""
from .group import Group
from .user import User
from .user import UserIndex
from .auth import Authentication
from .accesspoint import AccessPoint
| zh | 0.99666 | 用户, 组, 及相关认证数据库模型 | 1.446359 | 1 |
programacao basica/7.py | m-brito/Neps-Academy | 0 | 6143 | bino = int(input())
cino = int(input())
if (bino+cino)%2==0:
print("Bino")
else:
print("Cino")
| bino = int(input())
cino = int(input())
if (bino+cino)%2==0:
print("Bino")
else:
print("Cino")
| none | 1 | 3.804632 | 4 | |
update_readme.py | CalmScout/LeetCode | 0 | 6144 | """
Script updates `README.md` with respect to files at ./easy and ./medium folders.
"""
import os
curr_dir = os.path.dirname(__file__)
with open(os.path.join(curr_dir, "README.md"), 'w') as readme:
readme.write("# LeetCode\nDeliberate practice in coding.\n")
langs = [l for l in os.listdir(curr_dir) if os.path... | """
Script updates `README.md` with respect to files at ./easy and ./medium folders.
"""
import os
curr_dir = os.path.dirname(__file__)
with open(os.path.join(curr_dir, "README.md"), 'w') as readme:
readme.write("# LeetCode\nDeliberate practice in coding.\n")
langs = [l for l in os.listdir(curr_dir) if os.path... | en | 0.45586 | Script updates `README.md` with respect to files at ./easy and ./medium folders. # {}\n".format(lang)) ## Easy\n") ## Medium\n") | 2.700258 | 3 |
scripts/biotimesql.py | Jay-Iam/retriever | 0 | 6145 | # -*- coding: utf-8 -*-
#retriever
import csv
from pkg_resources import parse_version
from retriever.lib.models import Table
from retriever.lib.templates import Script
try:
from retriever.lib.defaults import VERSION
try:
from retriever.lib.tools import open_fr, open_fw, open_csvw
except ImportEr... | # -*- coding: utf-8 -*-
#retriever
import csv
from pkg_resources import parse_version
from retriever.lib.models import Table
from retriever.lib.templates import Script
try:
from retriever.lib.defaults import VERSION
try:
from retriever.lib.tools import open_fr, open_fw, open_csvw
except ImportEr... | en | 0.354917 | # -*- coding: utf-8 -*- #retriever #.WskN7dPwYyn" # Create abundance table # Create allrawdata table # Create biomass table # Create citation1 table # Create contacts table # Create countries table # Create curation table # Create datasets table # Create downloads table # Create methods table # Create sample table # Cr... | 2.239966 | 2 |
alipay/aop/api/domain/KbAdvertSettleBillResponse.py | snowxmas/alipay-sdk-python-all | 213 | 6146 | <filename>alipay/aop/api/domain/KbAdvertSettleBillResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class KbAdvertSettleBillResponse(object):
def __init__(self):
self._download_url = None
self._paid_date = None
@proper... | <filename>alipay/aop/api/domain/KbAdvertSettleBillResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class KbAdvertSettleBillResponse(object):
def __init__(self):
self._download_url = None
self._paid_date = None
@proper... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.240032 | 2 |
day5.py | PLCoster/adventofcode2019 | 1 | 6147 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 11:06:59 2019
@author: Paul
"""
def read_data(filename):
"""
Reads csv file into a list, and converts to ints
"""
data = []
f = open(filename, 'r')
for line in f:
data += line.strip('\n').split(',')
... | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 11:06:59 2019
@author: Paul
"""
def read_data(filename):
"""
Reads csv file into a list, and converts to ints
"""
data = []
f = open(filename, 'r')
for line in f:
data += line.strip('\n').split(',')
... | en | 0.781257 | # -*- coding: utf-8 -*- Created on Mon Dec 2 11:06:59 2019
@author: Paul Reads csv file into a list, and converts to ints Takes data, list of ints to run int_code on.
Returns list of ints after intcode program has been run.
Running Intcode program looks reads in the integers sequentially in sets of ... | 3.733771 | 4 |
textvis/textprizm/models.py | scclab/textvisdrg-prototype | 0 | 6148 | from django.db import models
# Create your models here.
class Schema(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
class Code(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
active_instances = models.Posit... | from django.db import models
# Create your models here.
class Schema(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
class Code(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
active_instances = models.Posit... | en | 0.950814 | # Create your models here. Get messages that are inclusively between the two messages, or two dates. Takes into account the exact ordering of messages, meaning that you won't get messages at the same time but after the last message, for example. | 2.607315 | 3 |
test/test_purchasing.py | jacob22/accounting | 0 | 6149 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2019 Open End AB
#
# 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 appl... | # -*- coding: utf-8 -*-
# Copyright 2019 Open End AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | en | 0.826715 | # -*- coding: utf-8 -*- # Copyright 2019 Open End AB # # 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... | 2.029261 | 2 |
iot/downstream/fog_processes.py | SENERGY-Platform/senergy-connector | 0 | 6150 | """
Copyright 2020 InfAI (CC SES)
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... | """
Copyright 2020 InfAI (CC SES)
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... | en | 0.854506 | Copyright 2020 InfAI (CC SES) 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 writin... | 1.80472 | 2 |
django_project/user_profile/migrations/0003_order_payment_method.py | aliyaandabekova/DJANGO_PROJECT | 0 | 6151 | # Generated by Django 3.2.3 on 2021-05-27 13:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0002_auto_20210526_1747'),
]
operations = [
migrations.AddField(
model_name='order',
name='payment_m... | # Generated by Django 3.2.3 on 2021-05-27 13:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0002_auto_20210526_1747'),
]
operations = [
migrations.AddField(
model_name='order',
name='payment_m... | en | 0.880693 | # Generated by Django 3.2.3 on 2021-05-27 13:34 | 1.882064 | 2 |
day07/test.py | mpirnat/aoc2016 | 0 | 6152 | <reponame>mpirnat/aoc2016
#!/usr/bin/env python
import unittest
from day07 import has_abba, get_abba_allowed_strings, get_abba_disallowed_strings
from day07 import supports_tls, count_tls_addresses
from day07 import find_abas, supports_ssl, count_ssl_addresses
class TestFindingABBASequences(unittest.TestCase):
c... | #!/usr/bin/env python
import unittest
from day07 import has_abba, get_abba_allowed_strings, get_abba_disallowed_strings
from day07 import supports_tls, count_tls_addresses
from day07 import find_abas, supports_ssl, count_ssl_addresses
class TestFindingABBASequences(unittest.TestCase):
cases = (
('abba', ... | ru | 0.26433 | #!/usr/bin/env python | 2.544189 | 3 |
rlnets/PG.py | HTRPOCODES/HTRPO-v2 | 7 | 6153 | <reponame>HTRPOCODES/HTRPO-v2<gh_stars>1-10
import torch
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
from basenets.MLP import MLP
from basenets.Conv import Conv
from torch import nn
class FCPG_Gaussian(MLP):
def __init__(self,
n_inputfeats,
... | import torch
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
from basenets.MLP import MLP
from basenets.Conv import Conv
from torch import nn
class FCPG_Gaussian(MLP):
def __init__(self,
n_inputfeats,
n_actions,
sigma,
... | en | 0.65312 | # input dim # output dim # hidden unit number list # for exploration, we need to make sure that the std is not too low. # input dim # output dim # hidden unit number list # input dim # output dim # hidden unit number list # for exploration, and similar to e-greedy # input dim # output dim # hidden unit number list # in... | 2.307763 | 2 |
tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py | m4rkl1u/tensorflow | 2 | 6154 | # Copyright 2015 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... | # Copyright 2015 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... | en | 0.735431 | # Copyright 2015 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... | 1.798229 | 2 |
cloudroast/objectstorage/smoke/object_smoke.py | RULCSoft/cloudroast | 0 | 6155 | <filename>cloudroast/objectstorage/smoke/object_smoke.py
"""
Copyright 2015 Rackspace
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... | <filename>cloudroast/objectstorage/smoke/object_smoke.py
"""
Copyright 2015 Rackspace
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... | en | 0.782636 | Copyright 2015 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribu... | 1.816271 | 2 |
ceph/tests/conftest.py | remicalixte/integrations-core | 1 | 6156 | <reponame>remicalixte/integrations-core
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import pytest
from datadog_checks.dev import docker_run
from datadog_checks.dev.conditions import CheckDockerLogs
from datadog_checks.dev.subprocess imp... | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import pytest
from datadog_checks.dev import docker_run
from datadog_checks.dev.conditions import CheckDockerLogs
from datadog_checks.dev.subprocess import run_command
from .common import BAS... | en | 0.836247 | # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # We need a custom condition to wait a bit longer # Clean the disk space warning # Wait a bit for the change to take effect | 1.740025 | 2 |
federation/hostmeta/fetchers.py | weex/federation | 93 | 6157 | import json
from typing import Dict, Optional
import requests
from federation.hostmeta.parsers import (
parse_nodeinfo_document, parse_nodeinfo2_document, parse_statisticsjson_document, parse_mastodon_document,
parse_matrix_document, parse_misskey_document)
from federation.utils.network import fetch_document
... | import json
from typing import Dict, Optional
import requests
from federation.hostmeta.parsers import (
parse_nodeinfo_document, parse_nodeinfo2_document, parse_statisticsjson_document, parse_mastodon_document,
parse_matrix_document, parse_misskey_document)
from federation.utils.network import fetch_document
... | en | 0.599891 | # ¯\_(ツ)_/¯ # Buggy NodeInfo from certain old Hubzilla versions # Another buggy NodeInfo from certain old Hubzilla versions | 2.424595 | 2 |
features/analysis_features.py | iag0g0mes/t2_fis_driving_style | 5 | 6158 | <gh_stars>1-10
import numpy as np
from typing import Any, Dict, List, Tuple, NoReturn
import argparse
import os
def parse_arguments() -> Any:
"""Parse command line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_dir",
default="",
type=str,
help="Directory where the feature... | import numpy as np
from typing import Any, Dict, List, Tuple, NoReturn
import argparse
import os
def parse_arguments() -> Any:
"""Parse command line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_dir",
default="",
type=str,
help="Directory where the features (npy files) a... | en | 0.404815 | Parse command line arguments. #central tendency : mean #dispersion : std #bounds : min max #quantile : 0.25, 0.5, 0.75 #_filters = ['none', 'ekf', 'savgol', 'ekf-savgol'] #_modes = ['train', 'val', 'test', 'sample'] #_obs_len = [2,5] #seg = _obs_len[0] #mode = _modes[3] #filter_name = _filters[0... | 2.620173 | 3 |
python-watcher-2.0.0/watcher/tests/notifications/test_service_notifications.py | scottwedge/OpenStack-Stein | 0 | 6159 | # -*- encoding: utf-8 -*-
# Copyright (c) 2017 Servionica
#
# 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 l... | # -*- encoding: utf-8 -*-
# Copyright (c) 2017 Servionica
#
# 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 l... | en | 0.841331 | # -*- encoding: utf-8 -*- # Copyright (c) 2017 Servionica # # 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 l... | 1.800168 | 2 |
leetcode/medium/best-time-to-buy-and-sell-stock-ii.py | rainzhop/cumulus-tank | 0 | 6160 | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
#
# Say you have an array for which the ith element is the price of a given stock on day i.
#
# Design an algorithm to find the maximum profit.
# You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple ti... | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
#
# Say you have an array for which the ith element is the price of a given stock on day i.
#
# Design an algorithm to find the maximum profit.
# You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple ti... | en | 0.919084 | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ # # Say you have an array for which the ith element is the price of a given stock on day i. # # Design an algorithm to find the maximum profit. # You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple ti... | 3.849453 | 4 |
django_loci/tests/base/test_admin.py | yashikajotwani12/django-loci | 205 | 6161 | <filename>django_loci/tests/base/test_admin.py
import json
import os
import responses
from django.urls import reverse
from .. import TestAdminMixin, TestLociMixin
class BaseTestAdmin(TestAdminMixin, TestLociMixin):
geocode_url = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/'
def tes... | <filename>django_loci/tests/base/test_admin.py
import json
import os
import responses
from django.urls import reverse
from .. import TestAdminMixin, TestLociMixin
class BaseTestAdmin(TestAdminMixin, TestLociMixin):
geocode_url = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/'
def tes... | en | 0.663602 | # remove floorplan image # remove floorplan image # Mock HTTP request to the URL to work offline # Mock HTTP request to the URL to work offline | 2.345545 | 2 |
dca_models/deform_offsets_module.py | vatsalag99/Deformable-Channel-Attention | 1 | 6162 | import torch
from torch import nn
from torch.nn.parameter import Parameter
from einops import rearrange, reduce, repeat
class dca_offsets_layer(nn.Module):
"""Constructs a Offset Generation module.
"""
def __init__(self, channel, n_offsets):
super(dca_offsets_layer, self).__init__()
self.... | import torch
from torch import nn
from torch.nn.parameter import Parameter
from einops import rearrange, reduce, repeat
class dca_offsets_layer(nn.Module):
"""Constructs a Offset Generation module.
"""
def __init__(self, channel, n_offsets):
super(dca_offsets_layer, self).__init__()
self.... | en | 0.608504 | Constructs a Offset Generation module. Takes in a feature map and returns the unnormalized covariance matrix | 2.453 | 2 |
tests/__init__.py | egor43/PyImageComparsion | 0 | 6163 | from . import test_helpers
from . import test_image_opener
from . import test_image_metrick
from . import test_compare_tools
from . import test_compare_api | from . import test_helpers
from . import test_image_opener
from . import test_image_metrick
from . import test_compare_tools
from . import test_compare_api | none | 1 | 0.978423 | 1 | |
core/urls.py | donnellan0007/blog | 0 | 6164 | <filename>core/urls.py
from django.contrib import admin
from django.urls import path
from .views import index, email, post_detail, posts, hot_takes, take_detail
from . import views
app_name = "core"
urlpatterns = [
path('',views.index,name="index"),
path('email/',views.email,name="email"),
path('post/<slu... | <filename>core/urls.py
from django.contrib import admin
from django.urls import path
from .views import index, email, post_detail, posts, hot_takes, take_detail
from . import views
app_name = "core"
urlpatterns = [
path('',views.index,name="index"),
path('email/',views.email,name="email"),
path('post/<slu... | none | 1 | 1.76712 | 2 | |
griddy/__init__.py | pgolding/pandas-grid | 1 | 6165 | <reponame>pgolding/pandas-grid
from .grid import render_table | from .grid import render_table | none | 1 | 1.0486 | 1 | |
utils/dbconn.py | iamvishnuks/Xmigrate | 4 | 6166 | from mongoengine import *
from dotenv import load_dotenv
from os import getenv
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
from cassandra.cqlengine import connection
from cassandra.cqlengine.management import sync_table
from cassandra.query import ordered_dict_factory
from mod... | from mongoengine import *
from dotenv import load_dotenv
from os import getenv
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
from cassandra.cqlengine import connection
from cassandra.cqlengine.management import sync_table
from cassandra.query import ordered_dict_factory
from mod... | en | 0.488612 | CREATE KEYSPACE IF NOT EXISTS migration WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': '2' } | 2.139926 | 2 |
src/syft/lib/__init__.py | godormad/PySyft | 0 | 6167 | <reponame>godormad/PySyft
# stdlib
import importlib
import sys
from typing import Any
from typing import Any as TypeAny
from typing import Dict as TypeDict
from typing import Optional
# third party
from packaging import version
# syft relative
from ..ast.globals import Globals
from ..lib.python import create_python_a... | # stdlib
import importlib
import sys
from typing import Any
from typing import Any as TypeAny
from typing import Dict as TypeDict
from typing import Optional
# third party
from packaging import version
# syft relative
from ..ast.globals import Globals
from ..lib.python import create_python_ast
from ..lib.torch import... | en | 0.821505 | # stdlib # third party # syft relative # see if python version is supported # see if torch version is supported # third party # cache the constructor for future created clients # now we need to load the relevant frameworks onto the node # numpy_ast = create_numpy_ast() # let the misc creation be always the last, as it ... | 2.084133 | 2 |
scripts/griffin_GC_counts.py | GavinHaLab/Griffin | 1 | 6168 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pysam
import os
import pandas as pd
import numpy as np
import time
import argparse
import sys
from multiprocessing import Pool
# In[ ]:
# ##arguments for testing
# bam_file_path = '/fh/scratch/delete90/ha_g/realigned_bams/cfDNA_MBC_ULP_hg38/realign_bam_pa... | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pysam
import os
import pandas as pd
import numpy as np
import time
import argparse
import sys
from multiprocessing import Pool
# In[ ]:
# ##arguments for testing
# bam_file_path = '/fh/scratch/delete90/ha_g/realigned_bams/cfDNA_MBC_ULP_hg38/realign_bam_pa... | en | 0.588191 | #!/usr/bin/env python # coding: utf-8 # In[ ]: # In[ ]: # ##arguments for testing # bam_file_path = '/fh/scratch/delete90/ha_g/realigned_bams/cfDNA_MBC_ULP_hg38/realign_bam_paired_snakemake-master/results/MBC_1041_1_ULP/MBC_1041_1_ULP_recalibrated.bam' # bam_file_name = 'MBC_1041_1_ULP' # mapable_path = '../../download... | 1.898484 | 2 |
task2/04-task2-upload-dim-tables.py | canovasjm/InterviewProject_JuanCanovas | 0 | 6169 | <reponame>canovasjm/InterviewProject_JuanCanovas
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 1 18:17:07 2021
@author: jm
"""
# %% required libraries
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
# %% connect to DB
# create connection using pymssql
engine = cr... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 1 18:17:07 2021
@author: jm
"""
# %% required libraries
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
# %% connect to DB
# create connection using pymssql
engine = create_engine('mssql+pymssql://sa:<<PASSWORD>>@loca... | en | 0.572879 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon Mar 1 18:17:07 2021 @author: jm # %% required libraries # %% connect to DB # create connection using pymssql # %% read data sets from where I will build the dimension tables # read employee roster data # read skills data # read hours data # %% dimensions c... | 2.736785 | 3 |
cogs/server.py | vikasbaghel1001/Kanna-Chan | 5 | 6170 | import discord
from discord.ext import commands
arrow = "<a:right:877425183839891496>"
kwee = "<:kannawee:877036162122924072>"
kdance = "<a:kanna_dance:877038778798207016>"
kbored = "<:kanna_bored:877036162827583538>"
ksmug = "<:kanna_smug:877038777896427560>"
heart = "<a:explosion_heart:877426228775227392>"
class Se... | import discord
from discord.ext import commands
arrow = "<a:right:877425183839891496>"
kwee = "<:kannawee:877036162122924072>"
kdance = "<a:kanna_dance:877038778798207016>"
kbored = "<:kanna_bored:877036162827583538>"
ksmug = "<:kanna_smug:877038777896427560>"
heart = "<a:explosion_heart:877426228775227392>"
class Se... | en | 0.530273 | #877030933847490691> Read the rules here.\n{arrow} <#877031867440832574> Channel for grabbing self-roles.\n{arrow} <#876798564704084011> The general chat for the server.\n{arrow} <#876798809819189249> Bot Commands should be executed here.\n{arrow} <#876798696078065694> You can give suggestions for improving Kanna Chan ... | 2.556818 | 3 |
test/run/t344.py | timmartin/skulpt | 2,671 | 6171 | for ch in "Hello world!":
d = ord(ch)
h = hex(d)
o = oct(d)
b = bin(d)
print ch, d, h, o, b
| for ch in "Hello world!":
d = ord(ch)
h = hex(d)
o = oct(d)
b = bin(d)
print ch, d, h, o, b
| none | 1 | 3.388303 | 3 | |
paho/mqtt/subscribe.py | RandomGamer342/TTM4115-plantsensor | 8 | 6172 | <gh_stars>1-10
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# ... | # Copyright (c) 2016 <NAME> <<EMAIL>>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
# http://www.ecl... | en | 0.766285 | # Copyright (c) 2016 <NAME> <<EMAIL>> # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at # http://www.ecl... | 2.363026 | 2 |
py/2017/day24/aoc_day_24.py | cs-cordero/advent-of-code | 0 | 6173 | <gh_stars>0
from collections import defaultdict
def solution():
starting_components = d[0]
best_scores = []
for component in starting_components:
n_a, n_b = get_ports(component)
nxt_port = n_a if n_b == 0 else n_b
best_scores.append(recurse(component, set(), nxt_port, 0))
print... | from collections import defaultdict
def solution():
starting_components = d[0]
best_scores = []
for component in starting_components:
n_a, n_b = get_ports(component)
nxt_port = n_a if n_b == 0 else n_b
best_scores.append(recurse(component, set(), nxt_port, 0))
print("fuck", max... | en | 0.794068 | # with open('aoc_day_24_sample.txt') as f: # sample = [ # '0/1', # '1/2', # '1/3', # '1/4', # '5/0', # '2/5', # '3/6', # '4/500' # ] | 2.71706 | 3 |
scratchnet/scratchnet.py | Gr1m3y/scratchnet | 0 | 6174 | import numpy as np
import network
def main():
x = np.array([2, 3])
nw = network.NeuralNetwork()
print(nw.feedforward(x))
if __name__ == "__main__":
main()
| import numpy as np
import network
def main():
x = np.array([2, 3])
nw = network.NeuralNetwork()
print(nw.feedforward(x))
if __name__ == "__main__":
main()
| none | 1 | 3.138698 | 3 | |
live-plotting.py | rmhsawyer/EC601-Final-Project-Mapping_User_Face_To_Emoji | 0 | 6175 | <reponame>rmhsawyer/EC601-Final-Project-Mapping_User_Face_To_Emoji
#draw the predictions from real-time.py
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
style.use('fivethirtyeight')
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
def animate(i):
graph_data ... | #draw the predictions from real-time.py
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
style.use('fivethirtyeight')
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
def animate(i):
graph_data = open('emotion.txt', 'r').read()
lines = graph_data.split('\n'... | en | 0.88357 | #draw the predictions from real-time.py | 3.344592 | 3 |
code/run_policy.py | kirk86/ARS | 0 | 6176 | <reponame>kirk86/ARS
"""
Code to load a policy and generate rollout data. Adapted from https://github.com/berkeleydeeprlcourse.
Example usage:
python run_policy.py ../trained_policies/Humanoid-v1/policy_reward_11600/lin_policy_plus.npz Humanoid-v1 --render \
--num_rollouts 20
"""
import numpy as np
imp... | """
Code to load a policy and generate rollout data. Adapted from https://github.com/berkeleydeeprlcourse.
Example usage:
python run_policy.py ../trained_policies/Humanoid-v1/policy_reward_11600/lin_policy_plus.npz Humanoid-v1 --render \
--num_rollouts 20
"""
import numpy as np
import gym
def main():... | en | 0.598277 | Code to load a policy and generate rollout data. Adapted from https://github.com/berkeleydeeprlcourse. Example usage: python run_policy.py ../trained_policies/Humanoid-v1/policy_reward_11600/lin_policy_plus.npz Humanoid-v1 --render \ --num_rollouts 20 # mean and std of state vectors estimated online by ... | 2.875932 | 3 |
src/poliastro/plotting/tisserand.py | TreshUp/poliastro | 0 | 6177 | """ Generates Tisserand plots """
from enum import Enum
import numpy as np
from astropy import units as u
from matplotlib import pyplot as plt
from poliastro.plotting._base import BODY_COLORS
from poliastro.twobody.mean_elements import get_mean_elements
from poliastro.util import norm
class TisserandKind(Enum):
... | """ Generates Tisserand plots """
from enum import Enum
import numpy as np
from astropy import units as u
from matplotlib import pyplot as plt
from poliastro.plotting._base import BODY_COLORS
from poliastro.twobody.mean_elements import get_mean_elements
from poliastro.util import norm
class TisserandKind(Enum):
... | en | 0.523737 | Generates Tisserand plots All possible Tisserand kinds Generates Tisserand figures Object initializer Parameters ---------- kind : TisserandKind Nature for the Tisserand axes : ~matplotlib.pyplot.axes Axes for the figure # Asign Tisserand kind # Check if axis ava... | 2.959745 | 3 |
libs/Rack.py | jlin/inventory | 22 | 6178 | from KeyValueTree import KeyValueTree
from truth.models import KeyValue as TruthKeyValue, Truth
from systems.models import KeyValue as KeyValue
from django.test.client import RequestFactory
from api_v2.keyvalue_handler import KeyValueHandler
import json
factory = RequestFactory()
class Rack:
rack_name = None
... | from KeyValueTree import KeyValueTree
from truth.models import KeyValue as TruthKeyValue, Truth
from systems.models import KeyValue as KeyValue
from django.test.client import RequestFactory
from api_v2.keyvalue_handler import KeyValueHandler
import json
factory = RequestFactory()
class Rack:
rack_name = None
... | none | 1 | 2.201851 | 2 | |
r2c_isg/functions/__init__.py | returntocorp/inputset-generator | 3 | 6179 | from .trim import trim
from .sample import sample
from .sort import sort
function_map = {
'trim': trim,
'sample': sample,
'sort': sort
}
| from .trim import trim
from .sample import sample
from .sort import sort
function_map = {
'trim': trim,
'sample': sample,
'sort': sort
}
| none | 1 | 1.659389 | 2 | |
__init__.py | csalyk/nirspec | 0 | 6180 | from .nirspec import divspec
from .nirspec import gluespec
| from .nirspec import divspec
from .nirspec import gluespec
| none | 1 | 0.93816 | 1 | |
poem.py | xcollantes/poetry-generator | 0 | 6181 | from __future__ import absolute_import
from __future__ import print_function
import datetime
import os
import random
import sys
import uuid
import base64
import yaml
import re
try:
import en
except:
print("DOWNLOD NODECUBE")
print("""wget https://www.nodebox.net/code/data/media/linguistics.zip
unzip lingui... | from __future__ import absolute_import
from __future__ import print_function
import datetime
import os
import random
import sys
import uuid
import base64
import yaml
import re
try:
import en
except:
print("DOWNLOD NODECUBE")
print("""wget https://www.nodebox.net/code/data/media/linguistics.zip
unzip lingui... | en | 0.391036 | wget https://www.nodebox.net/code/data/media/linguistics.zip unzip linguistics.zip # else: # v = self.generate("<verb>", 1).strip() #tool = language_check.LanguageTool('en-US') # noPunc = True # for punc in list(set(puncuation)): # if punc in word: # noPunc = False # if noPunc: # poem3.append(random... | 2.61288 | 3 |
openstack/tests/unit/block_storage/v2/test_proxy.py | infonova/openstacksdk | 0 | 6182 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | en | 0.859654 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t... | 1.935664 | 2 |
src/ncstyler/console.py | starofrainnight/ncstyler | 0 | 6183 | <reponame>starofrainnight/ncstyler<gh_stars>0
#!/usr/bin/env python
import argparse
import CppHeaderParser
import re
import sys
import yaml
import copy
import six
import os.path
import traceback
class CppDefine(dict):
def __init__(self):
self["name"] = None
self["parameters"] = []
self["li... | #!/usr/bin/env python
import argparse
import CppHeaderParser
import re
import sys
import yaml
import copy
import six
import os.path
import traceback
class CppDefine(dict):
def __init__(self):
self["name"] = None
self["parameters"] = []
self["line_number"] = -1
class CppDefineParameter(dic... | en | 0.74611 | #!/usr/bin/env python A styler just target to naming conventions of source code # If user does not specific output path, we default it to input file # path # If it's a functor?? with "class name::function" style # with normal "function" style # Special config use to define filename rule # Operator methods # Ext... | 2.755148 | 3 |
theone/wsgi/server.py | laozijiaojiangnan/TheOne | 0 | 6184 | <gh_stars>0
import typing as t
from http.server import HTTPServer, BaseHTTPRequestHandler
from . import response as resp
class WsgiServer(HTTPServer):
pass
class WsgiHandel(BaseHTTPRequestHandler):
def handle(self) -> None:
handle_response = SimpleHandler(self.wfile)
handle_response.send()... | import typing as t
from http.server import HTTPServer, BaseHTTPRequestHandler
from . import response as resp
class WsgiServer(HTTPServer):
pass
class WsgiHandel(BaseHTTPRequestHandler):
def handle(self) -> None:
handle_response = SimpleHandler(self.wfile)
handle_response.send()
class Sim... | zh | 0.839505 | # type: resp.Response 像浏览器发送包 node: 下面分成了三次发送,因为合在发送会有 bug,不确定问题,暂时先这样 添加请求头键值对 Args: key: 键 value: 值 Return: 存在的所有键值对信息 | 2.850014 | 3 |
pytorch_translate/attention/multihead_attention.py | dzhulgakov/translate | 1 | 6185 | <filename>pytorch_translate/attention/multihead_attention.py
#!/usr/bin/env python3
from fairseq.modules import multihead_attention as fair_multihead
from pytorch_translate.attention import (
BaseAttention,
attention_utils,
register_attention,
)
@register_attention("multihead")
class MultiheadAttention(... | <filename>pytorch_translate/attention/multihead_attention.py
#!/usr/bin/env python3
from fairseq.modules import multihead_attention as fair_multihead
from pytorch_translate.attention import (
BaseAttention,
attention_utils,
register_attention,
)
@register_attention("multihead")
class MultiheadAttention(... | en | 0.609057 | #!/usr/bin/env python3 Multiheaded Scaled Dot Product Attention Implements equation: MultiHead(Q, K, V) = Concat(head_1,...,head_h)W^O where head_i = Attention(QW_i^Q, KW_i^K, VW_i^V) Similarly to the above, d_k = d_v = d_model / h In this implementation, keys and values are both set to encode... | 2.619547 | 3 |
custom_components/purrsong/__init__.py | RobertD502/home-assistant-lavviebot | 3 | 6186 | """Support for Purrsong LavvieBot S"""
import asyncio
import logging
import voluptuous as vol
from lavviebot import LavvieBotApi
import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.exceptions import Co... | """Support for Purrsong LavvieBot S"""
import asyncio
import logging
import voluptuous as vol
from lavviebot import LavvieBotApi
import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.exceptions import Co... | en | 0.861809 | Support for Purrsong LavvieBot S Setup of the component Set up Lavviebot integration from a config entry. | 2.123748 | 2 |
MathPainting_OOP/shapes.py | matbocz/kurs-python-udemy | 0 | 6187 | class Rectangle:
"""A rectangle shape that can be drawn on a Canvas object"""
def __init__(self, x, y, width, height, color):
self.x = x
self.y = y
self.width = width
self.height = height
self.color = color
def draw(self, canvas):
"""Draws itself into the Ca... | class Rectangle:
"""A rectangle shape that can be drawn on a Canvas object"""
def __init__(self, x, y, width, height, color):
self.x = x
self.y = y
self.width = width
self.height = height
self.color = color
def draw(self, canvas):
"""Draws itself into the Ca... | en | 0.792182 | A rectangle shape that can be drawn on a Canvas object Draws itself into the Canvas object # Changes a slice of the array with new values A square shape that can be drawn on a Canvas object Draws itself into the Canvas object # Changes a slice of the array with new values | 4.101859 | 4 |
problems/Kelvin_Helmholtz/problem.py | sddyates/mars | 1 | 6188 |
from mars import main_loop
import numpy as np
from mars.settings import *
class Problem:
"""
Synopsis
--------
User class for the Kelvin-Helmholtz instability
Args
----
None
Methods
-------
initialise
Set all variables in each cell to initialise the simulation.
i... |
from mars import main_loop
import numpy as np
from mars.settings import *
class Problem:
"""
Synopsis
--------
User class for the Kelvin-Helmholtz instability
Args
----
None
Methods
-------
initialise
Set all variables in each cell to initialise the simulation.
i... | en | 0.52583 | Synopsis -------- User class for the Kelvin-Helmholtz instability Args ---- None Methods ------- initialise Set all variables in each cell to initialise the simulation. internal_bc Specify the internal boundary for the simulation. TODO ---- None | 2.70017 | 3 |
pythainlp/util/thai.py | korkeatw/pythainlp | 0 | 6189 | # -*- coding: utf-8 -*-
"""
Check if it is Thai text
"""
import string
_DEFAULT_IGNORE_CHARS = string.whitespace + string.digits + string.punctuation
def isthaichar(ch: str) -> bool:
"""
Check if a character is Thai
เป็นอักษรไทยหรือไม่
:param str ch: input character
:return: True or False
"... | # -*- coding: utf-8 -*-
"""
Check if it is Thai text
"""
import string
_DEFAULT_IGNORE_CHARS = string.whitespace + string.digits + string.punctuation
def isthaichar(ch: str) -> bool:
"""
Check if a character is Thai
เป็นอักษรไทยหรือไม่
:param str ch: input character
:return: True or False
"... | en | 0.386003 | # -*- coding: utf-8 -*- Check if it is Thai text Check if a character is Thai เป็นอักษรไทยหรือไม่ :param str ch: input character :return: True or False Check if all character is Thai เป็นคำที่มีแต่อักษรไทยหรือไม่ :param str word: input text :param str ignore_chars: characters to be ignored (i.... | 4.178101 | 4 |
Numpy/tempCodeRunnerFile.py | zharmedia386/Data-Science-Stuff | 0 | 6190 | <reponame>zharmedia386/Data-Science-Stuff
print(b)
print(c)
print(d)
print(e)
print(f)
print(g) | print(b)
print(c)
print(d)
print(e)
print(f)
print(g) | none | 1 | 1.528013 | 2 | |
Python/Filter.py | KilroyWasHere-cs-j/savitzky-golay | 0 | 6191 | import numpy as np
from scipy.signal import savgol_filter
import matplotlib.pyplot as plt
import MadDog
x = []
y = []
def generate():
# Generate random data
base = np.linspace(0, 5, 11)
# base = np.random.randint(0, 10, 5)
outliers = np.random.randint(10, 20, 2)
data = np.concatenate((base, outli... | import numpy as np
from scipy.signal import savgol_filter
import matplotlib.pyplot as plt
import MadDog
x = []
y = []
def generate():
# Generate random data
base = np.linspace(0, 5, 11)
# base = np.random.randint(0, 10, 5)
outliers = np.random.randint(10, 20, 2)
data = np.concatenate((base, outli... | en | 0.374472 | # Generate random data # base = np.random.randint(0, 10, 5) # Build random data # np.sin(x) + np.cos(x) + np.random.random(100) # np.linspace(0, 2*np.pi, 100) # Generate some test data # Plotting # Generating the noisy signal # Savitzky-Golay filter | 2.75846 | 3 |
examples/adwords/v201406/advanced_operations/add_ad_customizer.py | dietrichc/streamline-ppc-reports | 0 | 6192 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | en | 0.824873 | #!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b... | 2.427286 | 2 |
tests/test_minhash.py | azachar/pyminhash | 0 | 6193 | import pytest
from pyminhash import MinHash
from pyminhash.datasets import load_data
def test__sparse_vector():
df = load_data()
myMinHasher = MinHash(10)
res = myMinHasher._sparse_vectorize(df, 'name')
assert res.columns.tolist() == ['name', 'sparse_vector']
assert res['sparse_vector'].dtype == ... | import pytest
from pyminhash import MinHash
from pyminhash.datasets import load_data
def test__sparse_vector():
df = load_data()
myMinHasher = MinHash(10)
res = myMinHasher._sparse_vectorize(df, 'name')
assert res.columns.tolist() == ['name', 'sparse_vector']
assert res['sparse_vector'].dtype == ... | none | 1 | 2.308998 | 2 | |
settings.py | danylo-dudok/youtube-rss | 0 | 6194 | from datetime import datetime, timedelta
from typing import final
from tools import localize_time
RSS_URL_PREFIX: final = 'https://www.youtube.com/feeds/videos.xml?channel_id={0}'
LOCATION_ARGUMENT_PREFIX: final = '--location='
CHANNEL_ARGUMENT_PREFIX: final = '--channels='
LAST_CHECK_ARGUMENT_PREFIX: final = '--last... | from datetime import datetime, timedelta
from typing import final
from tools import localize_time
RSS_URL_PREFIX: final = 'https://www.youtube.com/feeds/videos.xml?channel_id={0}'
LOCATION_ARGUMENT_PREFIX: final = '--location='
CHANNEL_ARGUMENT_PREFIX: final = '--channels='
LAST_CHECK_ARGUMENT_PREFIX: final = '--last... | none | 1 | 2.383024 | 2 | |
openpicle/caravel.py | DX-MON/OpenPICle | 0 | 6195 | # SPDX-License-Identifier: BSD-3-Clause
from amaranth import Elaboratable, Module, Signal, ResetInserter, EnableInserter
__all__ = (
'PIC16Caravel',
)
class PIC16Caravel(Elaboratable):
def elaborate(self, platform):
from .pic16 import PIC16
from .soc.busses.qspi import QSPIBus
m = Module()
reset = Signal()
... | # SPDX-License-Identifier: BSD-3-Clause
from amaranth import Elaboratable, Module, Signal, ResetInserter, EnableInserter
__all__ = (
'PIC16Caravel',
)
class PIC16Caravel(Elaboratable):
def elaborate(self, platform):
from .pic16 import PIC16
from .soc.busses.qspi import QSPIBus
m = Module()
reset = Signal()
... | de | 0.403161 | # SPDX-License-Identifier: BSD-3-Clause | 2.069705 | 2 |
cogs/stats.py | est73/raid-shack | 0 | 6196 | <reponame>est73/raid-shack<gh_stars>0
from discord.ext import commands
import discord
class Stats(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.has_permissions(manage_channels=True)
async def stats(self, ctx):
members = await ctx.guild.fetch_mem... | from discord.ext import commands
import discord
class Stats(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.has_permissions(manage_channels=True)
async def stats(self, ctx):
members = await ctx.guild.fetch_members(limit=None).flatten()
mem... | none | 1 | 2.540574 | 3 | |
tests/bucket/test_bucket.py | WillChilds-Klein/mistress-mapreduce | 2 | 6197 | from mrs.bucket import WriteBucket
from mrs import BinWriter, HexWriter
def test_writebucket():
b = WriteBucket(0, 0)
b.addpair((4, 'test'))
b.collect([(3, 'a'), (1, 'This'), (2, 'is')])
values = ' '.join(value for key, value in b)
assert values == 'test a This is'
b.sort()
values = ' '.j... | from mrs.bucket import WriteBucket
from mrs import BinWriter, HexWriter
def test_writebucket():
b = WriteBucket(0, 0)
b.addpair((4, 'test'))
b.collect([(3, 'a'), (1, 'This'), (2, 'is')])
values = ' '.join(value for key, value in b)
assert values == 'test a This is'
b.sort()
values = ' '.j... | fr | 0.543418 | # vim: et sw=4 sts=4 | 2.148079 | 2 |
inquire/agents/dempref.py | HARPLab/inquire | 0 | 6198 | <reponame>HARPLab/inquire
"""
An agent which uses demonstrations and preferences.
Code adapted from Learning Reward Functions
by Integrating Human Demonstrations and Preferences.
"""
import itertools
import os
import time
from pathlib import Path
from typing import Dict, List
import arviz as az
from inquire.agents.a... | """
An agent which uses demonstrations and preferences.
Code adapted from Learning Reward Functions
by Integrating Human Demonstrations and Preferences.
"""
import itertools
import os
import time
from pathlib import Path
from typing import Dict, List
import arviz as az
from inquire.agents.agent import Agent
from inq... | en | 0.798314 | An agent which uses demonstrations and preferences. Code adapted from Learning Reward Functions by Integrating Human Demonstrations and Preferences. A preference-querying agent seeded with demonstrations. Note: We instantiate the agent according to arguments corresponding to what the the original paper's code... | 3.057671 | 3 |
coba/learners/__init__.py | mrucker/banditbenchmark | 1 | 6199 | <reponame>mrucker/banditbenchmark<gh_stars>1-10
"""This module contains all public learners and learner interfaces."""
from coba.learners.primitives import Learner, SafeLearner
from coba.learners.bandit import EpsilonBanditLearner, UcbBanditLearner, FixedLearner, RandomLearner
from coba.learners.corral import ... | """This module contains all public learners and learner interfaces."""
from coba.learners.primitives import Learner, SafeLearner
from coba.learners.bandit import EpsilonBanditLearner, UcbBanditLearner, FixedLearner, RandomLearner
from coba.learners.corral import CorralLearner
from coba.learners.vowpal impo... | en | 0.804859 | This module contains all public learners and learner interfaces. | 1.440874 | 1 |