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
python/ray/tune/examples/pbt_dcgan_mnist/pbt_dcgan_mnist.py
sunho/ray
2
6625251
<gh_stars>1-10 #!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import ray from ray import tune from ray.tune.schedulers import PopulationBasedTraining from ray.tune.trial import ExportFormat import argparse import os from filelock imp...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import ray from ray import tune from ray.tune.schedulers import PopulationBasedTraining from ray.tune.trial import ExportFormat import argparse import os from filelock import FileLock im...
en
0.734335
#!/usr/bin/env python # Training parameters # Number of channels in the training images. For color images this is 3 # Size of z latent vector (i.e. size of generator input) # Size of feature maps in generator # Size of feature maps in discriminator # Beta1 hyperparam for Adam optimizers # iterations of actual training ...
2.116016
2
app/matching_algorithm/test_ford_fulkerson.py
KaviMD/ppe-exchange
0
6625252
from ford_fulkerson import FlowNetwork participants = { "1": "Jim", "2": "Mike", "3": "Kathy" } sku = { "a": "type a", "b": "type b", "c": "type c" } want = { "1": [ { "sku": "b", "count": 125 }, { "sku":...
from ford_fulkerson import FlowNetwork participants = { "1": "Jim", "2": "Mike", "3": "Kathy" } sku = { "a": "type a", "b": "type b", "c": "type c" } want = { "1": [ { "sku": "b", "count": 125 }, { "sku":...
en
0.206274
#print(participants[p], "wants", sku[s]) #print(participants[p], "has", sku[s]) # Display all connections # Display transactions fn = FlowNetwork() fn.addVertex('s', True, False) fn.addVertex('t', False, True) for v in ['a', 'b','c','d']: fn.addVertex(v) fn.addEdge('s', 'a', 4) fn.addEdge('a', 'b', 4) fn.addEdge('b...
2.62542
3
factual/query/write.py
gvelez17/factual-python-driver
1
6625253
from base import Base class Write(Base): def __init__(self, api, table, factual_id, params): self.table = table self.factual_id = factual_id Base.__init__(self, api, self._path(), params) def write(self): return self.api.post(self) def factual_id(self, factual_id): ...
from base import Base class Write(Base): def __init__(self, api, table, factual_id, params): self.table = table self.factual_id = factual_id Base.__init__(self, api, self._path(), params) def write(self): return self.api.post(self) def factual_id(self, factual_id): ...
none
1
2.793994
3
code/fireflyFunction.py
laurencee9/Symposium_optimization
0
6625254
<reponame>laurencee9/Symposium_optimization<gh_stars>0 """ Find minimum of a function (in 2D) """ import numpy as np import random as rdm import matplotlib.pyplot as plt import matplotlib.animation as animation plt.rcParams['text.usetex']=True plt.rcParams['text.latex.preamble']=[r'\usepackage{amsmath}'] plt.rc('fo...
""" Find minimum of a function (in 2D) """ import numpy as np import random as rdm import matplotlib.pyplot as plt import matplotlib.animation as animation plt.rcParams['text.usetex']=True plt.rcParams['text.latex.preamble']=[r'\usepackage{amsmath}'] plt.rc('font',**{'family':'serif','serif':['Computer Modern']}) p...
en
0.228385
Find minimum of a function (in 2D) #update intensity #update intensity # cbar = plt.colorbar(l) # plt.show() # X = data[temps] # print(t) # func = lambda x,y : (np.abs(x-2.5)+np.abs(y-2.5))**0.7 # func = lambda x : (np.sin((x[0]**2.0+x[1]**2.0)/2.0)/((x[0]/5)**2.0+(x[1]/5.0)**2.0))*-1 # func = lambda x : (np.abs(x[0])+...
3.278247
3
techman_robot_get_status/tm_get_status/image_pub.py
Fry-Bot/tmr_ros2
14
6625255
<reponame>Fry-Bot/tmr_ros2 import sys import socket import rclpy import queue import signal from rclpy.node import Node from sensor_msgs.msg import Image from flask import Flask, request, jsonify import numpy as np import cv2 from waitress import serve from datetime import datetime from cv_bridge import CvBridge, Cv...
import sys import socket import rclpy import queue import signal from rclpy.node import Node from sensor_msgs.msg import Image from flask import Flask, request, jsonify import numpy as np import cv2 from waitress import serve from datetime import datetime from cv_bridge import CvBridge, CvBridgeError import threadin...
en
0.339383
# clsssification # inference img here # detection # inference img here # no method # user defined method # user defined method # get key/value # check key/value # convert image data #file2np = np.fromstring(request.files['file'].read(), np.uint8) #img = cv2.imdecode(file2np, cv2.IMREAD_UNCHANGED) #cv2.imwrite('test.png...
2.332017
2
ptp/components/transforms/__init__.py
aasseman/pytorchpipe
232
6625256
<filename>ptp/components/transforms/__init__.py from .concatenate_tensor import ConcatenateTensor from .list_to_tensor import ListToTensor from .reduce_tensor import ReduceTensor from .reshape_tensor import ReshapeTensor __all__ = [ 'ConcatenateTensor', 'ListToTensor', 'ReduceTensor', 'ReshapeTensor',...
<filename>ptp/components/transforms/__init__.py from .concatenate_tensor import ConcatenateTensor from .list_to_tensor import ListToTensor from .reduce_tensor import ReduceTensor from .reshape_tensor import ReshapeTensor __all__ = [ 'ConcatenateTensor', 'ListToTensor', 'ReduceTensor', 'ReshapeTensor',...
none
1
1.244741
1
django_scripts/dj.py
rsalmaso/django-scripts
0
6625257
<reponame>rsalmaso/django-scripts #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2015, <NAME> <<EMAIL>> # # 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 restrict...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2015, <NAME> <<EMAIL>> # # 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 ...
en
0.747323
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2007-2015, <NAME> <<EMAIL>> # # 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 t...
2.266728
2
circuitPython/examples/image-slide-viewer/ui_astc.py
BRTSG-FOSS/pico-bteve
1
6625258
<filename>circuitPython/examples/image-slide-viewer/ui_astc.py import time from brteve.brt_eve_bt817_8 import BrtEve class ui_astc: def __init__(self, eve: BrtEve) -> None: self.eve=eve self.x = 0 self.y = 0 self.w = 0 self.h = 0 self.index = 0 self.image_num...
<filename>circuitPython/examples/image-slide-viewer/ui_astc.py import time from brteve.brt_eve_bt817_8 import BrtEve class ui_astc: def __init__(self, eve: BrtEve) -> None: self.eve=eve self.x = 0 self.y = 0 self.w = 0 self.h = 0 self.index = 0 self.image_num...
en
0.335104
# eve.cmd_setbitmap(addr, eve.ASTC_4x4, w, h)
2.707298
3
src/lxml/tests/test_builder.py
wenovus/lxml
1,794
6625259
<gh_stars>1000+ # -*- coding: utf-8 -*- """ Tests that ElementMaker works properly. """ from __future__ import absolute_import import unittest from lxml import etree from lxml.builder import E from .common_imports import HelperTestCase, _bytes class BuilderTestCase(HelperTestCase): etree = etree def tes...
# -*- coding: utf-8 -*- """ Tests that ElementMaker works properly. """ from __future__ import absolute_import import unittest from lxml import etree from lxml.builder import E from .common_imports import HelperTestCase, _bytes class BuilderTestCase(HelperTestCase): etree = etree def test_build_from_xpa...
en
0.860268
# -*- coding: utf-8 -*- Tests that ElementMaker works properly.
2.618012
3
allure/structure.py
sergeychipiga/allure-python
0
6625260
<reponame>sergeychipiga/allure-python<gh_stars>0 ''' This holds allure report xml structures Created on Oct 23, 2013 @author: pupssman ''' from allure.rules import xmlfied, Attribute, Element, WrappedMany, Nested, Many from allure.constants import ALLURE_NAMESPACE, COMMON_NAMESPACE Attach = xmlfied('attachment', ...
''' This holds allure report xml structures Created on Oct 23, 2013 @author: pupssman ''' from allure.rules import xmlfied, Attribute, Element, WrappedMany, Nested, Many from allure.constants import ALLURE_NAMESPACE, COMMON_NAMESPACE Attach = xmlfied('attachment', source=Attribute(), ...
en
0.895656
This holds allure report xml structures Created on Oct 23, 2013 @author: pupssman
1.825868
2
src/kestrel/codegen/commands.py
imolloy/kestrel-lang
0
6625261
################################################################ # Module Summary # # - Code generation for each command in kestrel.lark # - The execution function names match commands in kestrel.lark # - Each command takes 2 arguments # ( statement, session ) # - statement is the current ...
################################################################ # Module Summary # # - Code generation for each command in kestrel.lark # - The execution function names match commands in kestrel.lark # - Each command takes 2 arguments # ( statement, session ) # - statement is the current ...
en
0.554832
################################################################ # Module Summary # # - Code generation for each command in kestrel.lark # - The execution function names match commands in kestrel.lark # - Each command takes 2 arguments # ( statement, session ) # - statement is the current ...
2.21754
2
tests/s3/test_s3_copier.py
BigNerd/justmltools
0
6625262
from unittest import TestCase from unittest.mock import MagicMock, patch from justmltools.s3.aws_credentials import AwsCredentials class TestS3Copier(TestCase): @patch('boto3.resource', autospec=True) @patch('justmltools.s3.s3_bucket_object_finder.S3BucketObjectFinder', autospec=True) def test_copy_s3_o...
from unittest import TestCase from unittest.mock import MagicMock, patch from justmltools.s3.aws_credentials import AwsCredentials class TestS3Copier(TestCase): @patch('boto3.resource', autospec=True) @patch('justmltools.s3.s3_bucket_object_finder.S3BucketObjectFinder', autospec=True) def test_copy_s3_o...
none
1
2.346538
2
tests/scanner/test_scanner.py
amasiukevich/InterpreterNew
0
6625263
from src.data_source.string_source import StringSource from src.data_source.file_source import FileSource from src.exceptions.scanning_exception import ScanningException from src.scanner.scanner import Scanner from src.utils.token_type import TokenType from src.utils.token import Token from src.utils.position import Po...
from src.data_source.string_source import StringSource from src.data_source.file_source import FileSource from src.exceptions.scanning_exception import ScanningException from src.scanner.scanner import Scanner from src.utils.token_type import TokenType from src.utils.token import Token from src.utils.position import Po...
en
0.687748
# test if raised exception for missing " # a comment"),
2.557368
3
utils/drawseg.py
JiangXiaobai00/FCNonKitti-Cityscapes
2
6625264
<reponame>JiangXiaobai00/FCNonKitti-Cityscapes from torch.utils.data import Dataset import numpy as np import torch from torchvision import transforms import random from skimage import io, transform import os from PIL import Image IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.P...
from torch.utils.data import Dataset import numpy as np import torch from torchvision import transforms import random from skimage import io, transform import os from PIL import Image IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',] class_name = ('road', 's...
en
0.425143
# use interpolation for quality # cause error if remove '.copy()' (prevent memory sharing) # mask #(384,1248,3) # B H W C np # how to write more elegantly #process #__imagenet_stats = {'mean': [0.5, 0.5, 0.5], # 'std': [0.5, 0.5, 0.5]} #__imagenet_stats ={'mean': [0.2902, 0.2976, 0.3042], # ...
2.353125
2
tests/test_version.py
drvinceknight/HierarchicalPromotion
0
6625265
import hierarchy as hrcy def test_version_is_str(): assert type(hrcy.__version__) is str
import hierarchy as hrcy def test_version_is_str(): assert type(hrcy.__version__) is str
none
1
2.018582
2
django-rgd-imagery/rgd_imagery/models/processed.py
ResonantGeoData/ResonantGeoData
40
6625266
<filename>django-rgd-imagery/rgd_imagery/models/processed.py from django.contrib.gis.db import models from django.utils.translation import gettext_lazy as _ from django_extensions.db.models import TimeStampedModel from rgd.models import ChecksumFile from rgd.models.mixins import PermissionPathMixin, Status, TaskEventMi...
<filename>django-rgd-imagery/rgd_imagery/models/processed.py from django.contrib.gis.db import models from django.utils.translation import gettext_lazy as _ from django_extensions.db.models import TimeStampedModel from rgd.models import ChecksumFile from rgd.models.mixins import PermissionPathMixin, Status, TaskEventMi...
en
0.599685
# TODO: permissions_paths Base class for processed images. # TODO: clean up ancillary_files - this throws an error when done through the admin interface # self.ancillary_files.all().delete()
2.022628
2
plugins/rapid7_insightvm/komand_rapid7_insightvm/actions/get_scan/schema.py
lukaszlaszuk/insightconnect-plugins
46
6625267
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Component: DESCRIPTION = "Get the status of a scan" class Input: SCAN_ID = "scan_id" class Output: ASSETS = "assets" DURATION = "duration" ENDTIME = "endTime" ENGINENAME = "engineName" ID = "id" LINKS = "li...
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Component: DESCRIPTION = "Get the status of a scan" class Input: SCAN_ID = "scan_id" class Output: ASSETS = "assets" DURATION = "duration" ENDTIME = "endTime" ENGINENAME = "engineName" ID = "id" LINKS = "li...
en
0.355766
# GENERATED BY KOMAND SDK - DO NOT EDIT { "type": "object", "title": "Variables", "properties": { "scan_id": { "type": "string", "title": "Scan ID", "description": "ID of the scan to obtain", "order": 1 } }, "required": [ "scan_id" ] } { "type": "object", "title": "Va...
2.332413
2
src/pretix/helpers/models.py
MaxRink/pretix
0
6625268
<reponame>MaxRink/pretix from django.db import models class Thumbnail(models.Model): source = models.CharField(max_length=255) size = models.CharField(max_length=255) thumb = models.FileField(upload_to='pub/thumbs/', max_length=255) class Meta: unique_together = (('source', 'size'),)
from django.db import models class Thumbnail(models.Model): source = models.CharField(max_length=255) size = models.CharField(max_length=255) thumb = models.FileField(upload_to='pub/thumbs/', max_length=255) class Meta: unique_together = (('source', 'size'),)
none
1
2.180432
2
utils/db_manage.py
Jaylen0829/tornado-RESTfulAPI
0
6625269
<filename>utils/db_manage.py # 设置模块路径,否则 apps 无法导入 import os, sys base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(base_path) sys.path.append(os.path.join(base_path,'apps')) from peewee import MySQLDatabase from apps.users.models import User, Group, Auth, AuthPermission # f...
<filename>utils/db_manage.py # 设置模块路径,否则 apps 无法导入 import os, sys base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(base_path) sys.path.append(os.path.join(base_path,'apps')) from peewee import MySQLDatabase from apps.users.models import User, Group, Auth, AuthPermission # f...
zh
0.721383
# 设置模块路径,否则 apps 无法导入 # from users.models import User 生成表 # sync_db.create_tables([UserProfile]) # 注意:如果检查没问题后数据库仍然报 (1215, 'Cannot add foreign key constraint') 那么需要使用下面的方式创建表,具体报错原因未知,可能create_tables内执行顺序不一致 # UserProfile.create_table() 修改表 # 由于peewee没办法像Django ORM那样迁移数据,因此如果在表创建好了之后还要对表字段做操作,就必须依靠peewee的migrate来操作了 #...
2.333197
2
var/spack/repos/builtin/packages/intltool/package.py
kkauder/spack
2,360
6625270
<gh_stars>1000+ # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Intltool(AutotoolsPackage): """intltool is a set of tools to centralize tr...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Intltool(AutotoolsPackage): """intltool is a set of tools to centralize translation of man...
en
0.763735
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) intltool is a set of tools to centralize translation of many different file formats using GNU gettext-compatible PO fil...
1.838875
2
src/wechaty_plugin_contrib/contrib/chat_history_plugin/data.py
wj-Mcat/python-wechaty-plugin-contrib
11
6625271
<reponame>wj-Mcat/python-wechaty-plugin-contrib<gh_stars>10-100 """ handle the chat history data """ from __future__ import annotations
""" handle the chat history data """ from __future__ import annotations
en
0.373569
handle the chat history data
1.058036
1
_broken/test_delete_annotation_all.py
SU-ECE-17-7/ibeis
0
6625272
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # TODO: ADD COPYRIGHT TAG from __future__ import absolute_import, division, print_function import multiprocessing import utool print, print_, printDBG, rrr, profile = utool.inject(__name__, '[TEST_DELETE_ANNOTATION_ALL]') def TEST_DELETE_ANNOTATION_ALL(ibs, back): ...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # TODO: ADD COPYRIGHT TAG from __future__ import absolute_import, division, print_function import multiprocessing import utool print, print_, printDBG, rrr, profile = utool.inject(__name__, '[TEST_DELETE_ANNOTATION_ALL]') def TEST_DELETE_ANNOTATION_ALL(ibs, back): ...
en
0.316397
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # TODO: ADD COPYRIGHT TAG # For windows # IBEIS Control # IBEIS GUI backend
1.969762
2
Natwest_Interview/distinct_integer.py
meghakashyap/Natwest_Questions
0
6625273
def nonDivisibleSubset(S,k): count = [0] * k for i in S: remainder = i % k count[remainder] +=1 ans = min( count[0] , 1) if k % 2 == 0: ans += min(count[k//2] ,1 ) for i in range( 1 , k//2 + 1): if i != k - i: ...
def nonDivisibleSubset(S,k): count = [0] * k for i in S: remainder = i % k count[remainder] +=1 ans = min( count[0] , 1) if k % 2 == 0: ans += min(count[k//2] ,1 ) for i in range( 1 , k//2 + 1): if i != k - i: ...
none
1
3.564579
4
functions.py
glauciocorreia/projeto-3estagio-python
0
6625274
#=====================================================================================================================================================================================# #FUNÇÕES ''' Sistemas para Internet 1º período 2017.2 Projeto Algoritmos e Programação Professor: Lamark Aluno: <NAME> ...
#=====================================================================================================================================================================================# #FUNÇÕES ''' Sistemas para Internet 1º período 2017.2 Projeto Algoritmos e Programação Professor: Lamark Aluno: <NAME> ...
pt
0.901646
#=====================================================================================================================================================================================# #FUNÇÕES Sistemas para Internet 1º período 2017.2 Projeto Algoritmos e Programação Professor: Lamark Aluno: <NAME> E-mail: <EM...
3.489933
3
apps/api/urls.py
MySmile/sfchat
4
6625275
<gh_stars>1-10 from django.conf.urls import * urlpatterns = [ #url(r'', include('apps.api.v2.urls', namespace='default')), url(r'^v1/', include('apps.api.v1.urls', namespace='v1')), ]
from django.conf.urls import * urlpatterns = [ #url(r'', include('apps.api.v2.urls', namespace='default')), url(r'^v1/', include('apps.api.v1.urls', namespace='v1')), ]
tr
0.114962
#url(r'', include('apps.api.v2.urls', namespace='default')),
1.447825
1
charmcraft/commands/init.py
fakela/charmcraft
0
6625276
# Copyright 2020 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2020 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
en
0.881597
# Copyright 2020 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
2.13824
2
isi_mip/climatemodels/management/commands/import_numbers.py
thiasB/isimip
4
6625277
import re import urllib.request import logging from datetime import date from django.core.management.base import BaseCommand from isi_mip.pages.models import HomePage logger = logging.getLogger(__name__) class Command(BaseCommand): help = 'Imports ISIMIP numbers from a textfile link to display on homepage' ...
import re import urllib.request import logging from datetime import date from django.core.management.base import BaseCommand from isi_mip.pages.models import HomePage logger = logging.getLogger(__name__) class Command(BaseCommand): help = 'Imports ISIMIP numbers from a textfile link to display on homepage' ...
none
1
2.357985
2
authenticator.py
Fedalto/alfred-authenticator
0
6625278
from pyotp import TOTP from workflow.notify import notify def list_tokens(keychain, wf): for service, secret_key in keychain.iteritems(): token = TOTP(secret_key).now() _add_workflow_item(wf, service, token) wf.send_feedback() def add_new_service(keychain, wf, service, secret_key): wf.l...
from pyotp import TOTP from workflow.notify import notify def list_tokens(keychain, wf): for service, secret_key in keychain.iteritems(): token = TOTP(secret_key).now() _add_workflow_item(wf, service, token) wf.send_feedback() def add_new_service(keychain, wf, service, secret_key): wf.l...
none
1
2.268305
2
sahara/tests/scenario_unit/test_runner.py
redhat-openstack/sahara
0
6625279
<reponame>redhat-openstack/sahara # Copyright (c) 2015 Mirantis 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 a...
# Copyright (c) 2015 Mirantis 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 writ...
en
0.851104
# Copyright (c) 2015 Mirantis 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 writ...
1.537484
2
demo/demoproject/tests.py
Maplecroft/django-chartjs
0
6625280
"""Unit tests for chartjs api.""" import json from django.test import TestCase from django.core.urlresolvers import reverse from demoproject._compat import decode class LineChartJSTestCase(TestCase): def test_line_chartjs(self): resp = self.client.get(reverse('line_chart')) self.assertContains(r...
"""Unit tests for chartjs api.""" import json from django.test import TestCase from django.core.urlresolvers import reverse from demoproject._compat import decode class LineChartJSTestCase(TestCase): def test_line_chartjs(self): resp = self.client.get(reverse('line_chart')) self.assertContains(r...
en
0.551535
Unit tests for chartjs api.
2.75864
3
pytorch/AutoEncoderCIFAR10.py
quickgrid/CodeLab
0
6625281
<reponame>quickgrid/CodeLab """ References: https://www.kaggle.com/ljlbarbosa/convolution-autoencoder-pytorch """ import gc import torch from torch import nn from torchvision import datasets, transforms from torch.utils.data import DataLoader import matplotlib.pyplot as plt import numpy as np torch.m...
""" References: https://www.kaggle.com/ljlbarbosa/convolution-autoencoder-pytorch """ import gc import torch from torch import nn from torchvision import datasets, transforms from torch.utils.data import DataLoader import matplotlib.pyplot as plt import numpy as np torch.manual_seed(17) np.random.se...
en
0.806971
References: https://www.kaggle.com/ljlbarbosa/convolution-autoencoder-pytorch # unnormalize # convert from Tensor image # Zero out previous grads, forward pass, calculate loss, backpropagate, optimize # Training is blocked on non notebook until window closed
2.740201
3
neutron/services/segments/db.py
brandonlogan/neutron
0
6625282
# Copyright 2016 Hewlett Packard Enterprise Development, LP # # 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/LICENS...
# Copyright 2016 Hewlett Packard Enterprise Development, LP # # 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/LICENS...
en
0.880022
# Copyright 2016 Hewlett Packard Enterprise Development, LP # # 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/LICENS...
1.533337
2
poezio/xhtml.py
mathiasertl/poezio
0
6625283
<reponame>mathiasertl/poezio # Copyright 2010-2011 <NAME> <<EMAIL>> # # This file is part of Poezio. # # Poezio is free software: you can redistribute it and/or modify # it under the terms of the zlib license. See the COPYING file. """ Various methods to convert shell colors to poezio colors, xhtml code to shell color...
# Copyright 2010-2011 <NAME> <<EMAIL>> # # This file is part of Poezio. # # Poezio is free software: you can redistribute it and/or modify # it under the terms of the zlib license. See the COPYING file. """ Various methods to convert shell colors to poezio colors, xhtml code to shell colors, poezio colors to xhtml cod...
en
0.659182
# Copyright 2010-2011 <NAME> <<EMAIL>> # # This file is part of Poezio. # # Poezio is free software: you can redistribute it and/or modify # it under the terms of the zlib license. See the COPYING file. Various methods to convert shell colors to poezio colors, xhtml code to shell colors, poezio colors to xhtml code # n...
2.012077
2
grano/model/property.py
ANCIR/grano
30
6625284
<reponame>ANCIR/grano from datetime import datetime from sqlalchemy.orm import aliased from grano.core import db from grano.model.common import IntBase from grano.model.attribute import Attribute VALUE_COLUMNS = { 'value_string': basestring, 'value_datetime': datetime, 'value_integer': int, 'value_fl...
from datetime import datetime from sqlalchemy.orm import aliased from grano.core import db from grano.model.common import IntBase from grano.model.attribute import Attribute VALUE_COLUMNS = { 'value_string': basestring, 'value_datetime': datetime, 'value_integer': int, 'value_float': float, 'valu...
en
0.759136
# check file column first since file uses both # value_string and value_file_id # noqa
2.136096
2
web/addons/board/controllers.py
diogocs1/comps
1
6625285
# -*- coding: utf-8 -*- from xml.etree import ElementTree from openerp.addons.web.controllers.main import load_actions_from_ir_values from openerp.http import Controller, route, request class Board(Controller): @route('/board/add_to_dashboard', type='json', auth='user') def add_to_dashboard(self, menu_id, act...
# -*- coding: utf-8 -*- from xml.etree import ElementTree from openerp.addons.web.controllers.main import load_actions_from_ir_values from openerp.http import Controller, route, request class Board(Controller): @route('/board/add_to_dashboard', type='json', auth='user') def add_to_dashboard(self, menu_id, act...
en
0.778578
# -*- coding: utf-8 -*- # FIXME move this method to board.board model # Maybe should check the content instead of model board.board ?
1.993318
2
lessinline/services/admin.py
skpatro23/lessinline
0
6625286
<reponame>skpatro23/lessinline<filename>lessinline/services/admin.py from django.contrib import admin from lessinline.services.models import Service, Slot class SlotAdmin(admin.TabularInline): model = Slot extra = 1 @admin.register(Service) class ServiceAdmin(admin.ModelAdmin): list_display = ['name', '...
from django.contrib import admin from lessinline.services.models import Service, Slot class SlotAdmin(admin.TabularInline): model = Slot extra = 1 @admin.register(Service) class ServiceAdmin(admin.ModelAdmin): list_display = ['name', 'business', 'price', 'is_open'] inlines = [SlotAdmin]
none
1
1.984408
2
tests/_utils.py
nikitanovosibirsk/vedro-allure-reporter
1
6625287
<filename>tests/_utils.py from argparse import Namespace from contextlib import contextmanager from pathlib import Path from typing import Any, Dict, List, Optional from unittest.mock import Mock, patch from uuid import uuid4 import pytest from allure_commons.logger import AllureMemoryLogger from vedro.core import Dis...
<filename>tests/_utils.py from argparse import Namespace from contextlib import contextmanager from pathlib import Path from typing import Any, Dict, List, Optional from unittest.mock import Mock, patch from uuid import uuid4 import pytest from allure_commons.logger import AllureMemoryLogger from vedro.core import Dis...
none
1
2.185705
2
ARM_STM32/Serial-CAN-UI/UI.py
fuszenecker/ARM
1
6625288
<filename>ARM_STM32/Serial-CAN-UI/UI.py #!/usr/bin/python # ----------------------------------------------------------------------------- # This program is the user interface of the Serial-CAN converter. # Python, PyTk and PySerial must be installed on the host computer. # ---------------------------------------------...
<filename>ARM_STM32/Serial-CAN-UI/UI.py #!/usr/bin/python # ----------------------------------------------------------------------------- # This program is the user interface of the Serial-CAN converter. # Python, PyTk and PySerial must be installed on the host computer. # ---------------------------------------------...
en
0.391245
#!/usr/bin/python # ----------------------------------------------------------------------------- # This program is the user interface of the Serial-CAN converter. # Python, PyTk and PySerial must be installed on the host computer. # ----------------------------------------------------------------------------- # ------...
2.784543
3
Models/support_vector_regression.py
ayorkshireworrall/Regression-Models-Evaluator
0
6625289
# Support Vector Regression (SVR) from .regression import Regression class SupportVectorRegression(Regression): def __init__(self, dataset): super().__init__(dataset) from sklearn.preprocessing import StandardScaler self.sc_X = StandardScaler() self.sc_y = StandardScaler() ...
# Support Vector Regression (SVR) from .regression import Regression class SupportVectorRegression(Regression): def __init__(self, dataset): super().__init__(dataset) from sklearn.preprocessing import StandardScaler self.sc_X = StandardScaler() self.sc_y = StandardScaler() ...
en
0.509768
# Support Vector Regression (SVR)
2.949407
3
scripts/automation/regression/stateless_tests/stl_examples_test.py
alialnu/trex-core
0
6625290
#!/router/bin/python from .stl_general_test import CStlGeneral_Test, CTRexScenario import os, sys from misc_methods import run_command class STLExamples_Test(CStlGeneral_Test): """This class defines the IMIX testcase of the TRex traffic generator""" def explicitSetUp(self): # examples connect by thei...
#!/router/bin/python from .stl_general_test import CStlGeneral_Test, CTRexScenario import os, sys from misc_methods import run_command class STLExamples_Test(CStlGeneral_Test): """This class defines the IMIX testcase of the TRex traffic generator""" def explicitSetUp(self): # examples connect by thei...
en
0.877913
#!/router/bin/python This class defines the IMIX testcase of the TRex traffic generator # examples connect by their own # connect back at end of tests #Work around for trex-405. Remove when it is resolved
2.051669
2
robust_optim/train.py
shaun95/google-research
1
6625291
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
en
0.806573
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
2.220421
2
ooni/utils/__init__.py
Acidburn0zzz/ooni-probe
2
6625292
<filename>ooni/utils/__init__.py import shutil import string import random import signal import errno import gzip import os from datetime import datetime, timedelta from zipfile import ZipFile from twisted.python.filepath import FilePath from twisted.python.runtime import platform class Storage(dict): """ A ...
<filename>ooni/utils/__init__.py import shutil import string import random import signal import errno import gzip import os from datetime import datetime, timedelta from zipfile import ZipFile from twisted.python.filepath import FilePath from twisted.python.runtime import platform class Storage(dict): """ A ...
en
0.658231
A Storage object is like a dictionary except `obj.foo` can be used in addition to `obj['foo']`. >>> o = Storage(a=1) >>> o.a 1 >>> o['a'] 1 >>> o.a = 2 >>> o['a'] 2 >>> del o.a >>> o.a None Returns a random all uppercase alfa-n...
2.530457
3
py/libs/assetexchange_maya/__init__.py
ddesmond/assetexchange
0
6625293
from .mainthread import * from .plugin import *
from .mainthread import * from .plugin import *
none
1
1.088691
1
research/instahide_attack_2020/step_4_final_graph.py
andrewyguo/privacy
0
6625294
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
en
0.891049
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
2.473983
2
posthog/api/insight.py
msnitish/posthog
0
6625295
import json from typing import Any, Dict, Type from django.db.models import OuterRef, QuerySet, Subquery from django.db.models.query_utils import Q from django.http import HttpResponse from django.utils.text import slugify from django.utils.timezone import now from django_filters.rest_framework import DjangoFilterBack...
import json from typing import Any, Dict, Type from django.db.models import OuterRef, QuerySet, Subquery from django.db.models.query_utils import Q from django.http import HttpResponse from django.utils.text import slugify from django.utils.timezone import now from django_filters.rest_framework import DjangoFilterBack...
en
0.725334
Simplified serializer to speed response times when loading large amounts of objects. # last_refresh sometimes gets sent if dashboard_item is duplicated # tags are created separately as global tag relationships # Manual tag creation since this create method doesn't call super() # Remove is_sample if it's set as user has...
1.442327
1
src/solana/transaction.py
albert-vo-crypto/solana-py
0
6625296
<filename>src/solana/transaction.py """Library to package an atomic sequence of instructions to a transaction.""" from __future__ import annotations from dataclasses import dataclass from sys import maxsize from typing import Any, Dict, List, NamedTuple, NewType, Optional, Union from based58 import b58decode, b58enco...
<filename>src/solana/transaction.py """Library to package an atomic sequence of instructions to a transaction.""" from __future__ import annotations from dataclasses import dataclass from sys import maxsize from typing import Any, Dict, List, NamedTuple, NewType, Optional, Union from based58 import b58decode, b58enco...
en
0.675439
Library to package an atomic sequence of instructions to a transaction. # type: ignore # type: ignore Type for TransactionSignature. Constant for maximum over-the-wire size of a Transaction. Constant for standard length of a signature. Account metadata dataclass. An account's public key. True if an instruction requires...
2.472402
2
wykan/models/swimlane.py
MobiusM/Wykan
2
6625297
<gh_stars>1-10 from . import _WekanObject class Swimlane(_WekanObject): def __init__(self, id: str): super().__init__(id)
from . import _WekanObject class Swimlane(_WekanObject): def __init__(self, id: str): super().__init__(id)
none
1
1.786143
2
data.py
ofirbartal100/AMNLP_CoReference_Project
0
6625298
from transformers.tokenization_bart import BartTokenizer from utils import extract_clusters2, extract_mentions_to_predicted_clusters_from_clusters, extract_clusters_for_decode from metrics import CorefEvaluator, MentionEvaluator from torch.utils.data import Dataset from utils import flatten_list_of_lists import js...
from transformers.tokenization_bart import BartTokenizer from utils import extract_clusters2, extract_mentions_to_predicted_clusters_from_clusters, extract_clusters_for_decode from metrics import CorefEvaluator, MentionEvaluator from torch.utils.data import Dataset from utils import flatten_list_of_lists import js...
en
0.512766
# from consts import SPEAKER_START, SPEAKER_END, NULL_ID_FOR_COREF # self.examples, self.lengths, self.num_examples_filtered = self._tokenize(examples) # if there are mentions that end in the end of the scentence # need our clusters # valid cluster id #(id # id) #normal tokanization # token_ids.append(self.tokenizer.eo...
2.354894
2
terradem/massbalance.py
VAW-SwissTerra/terradem
1
6625299
"""Tools to calculate mass balance and convert appropriately from volume.""" from __future__ import annotations import json import os import pathlib import warnings from typing import Any, Callable import geopandas as gpd import numpy as np import pandas as pd import rasterio as rio import shapely from tqdm import tq...
"""Tools to calculate mass balance and convert appropriately from volume.""" from __future__ import annotations import json import os import pathlib import warnings from typing import Any, Callable import geopandas as gpd import numpy as np import pandas as pd import rasterio as rio import shapely from tqdm import tq...
en
0.669081
Tools to calculate mass balance and convert appropriately from volume. # Zone A55 is not covered by the zones, so hardcode this to be A54 instead. # Calculate the distance between the point and each lk50_outline centroid # Find the closest lk50 outline # Extract the representative zone for the closest lk50 outline. # C...
2.080963
2
examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_hooks.py
kstennettlull/dagster
0
6625300
<reponame>kstennettlull/dagster<gh_stars>0 from unittest import mock from dagster import DagsterEventType, ResourceDefinition, job, op from docs_snippets.concepts.solids_pipelines.op_hooks import ( a, notif_all, notif_all_dev, notif_all_prod, selective_notif, slack_message_on_failure, slack...
from unittest import mock from dagster import DagsterEventType, ResourceDefinition, job, op from docs_snippets.concepts.solids_pipelines.op_hooks import ( a, notif_all, notif_all_dev, notif_all_prod, selective_notif, slack_message_on_failure, slack_message_on_success, test_my_success_ho...
none
1
1.786185
2
src/flwr_experimental/ops/compute/docker_adapter_test.py
yiliucs/flower
1
6625301
# Copyright 2020 Adap GmbH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright 2020 Adap GmbH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
en
0.784339
# Copyright 2020 Adap GmbH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
1.897403
2
comentarios/forms.py
gabrielmachado395/Galart
0
6625302
from django.forms import ModelForm from .models import Comentario class FormComentario(ModelForm): def clean(self): data = self.cleaned_data nome = data.get('nome_comentario') email = data.get('email_comentario') comentario = data.get('comentario') if any(numero...
from django.forms import ModelForm from .models import Comentario class FormComentario(ModelForm): def clean(self): data = self.cleaned_data nome = data.get('nome_comentario') email = data.get('email_comentario') comentario = data.get('comentario') if any(numero...
none
1
2.567818
3
parebrick/characters/balanced.py
ctlab/parallel-rearrangements
3
6625303
from bg.grimm import GRIMMReader from bg.tree import BGTree from bg.genome import BGGenome from bg.vertices import BGVertex import numpy as np import os import csv get_colors_by_edge = lambda e: e.multicolor.multicolors def white_proportion(colors): return np.mean(list(map(lambda c: c == 0, colors))) def get_...
from bg.grimm import GRIMMReader from bg.tree import BGTree from bg.genome import BGGenome from bg.vertices import BGVertex import numpy as np import os import csv get_colors_by_edge = lambda e: e.multicolor.multicolors def white_proportion(colors): return np.mean(list(map(lambda c: c == 0, colors))) def get_...
en
0.54894
# consistency_checker = TreeConsistencyChecker(tree_file)
2.392422
2
cproto/core/cproto.py
asyne/cproto
30
6625304
from __future__ import absolute_import import json from os import path try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen from cproto.core.websocket import WebSocket from cproto.domains.factory import DomainFactory ROOT_DIR = path.abspath(path.dirname(path.dirname(__file...
from __future__ import absolute_import import json from os import path try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen from cproto.core.websocket import WebSocket from cproto.domains.factory import DomainFactory ROOT_DIR = path.abspath(path.dirname(path.dirname(__file...
en
0.81589
# Build Domain Class from protocol # Set WebSocket attribute # Set Domain's Class as a property
2.466406
2
sdk/python/pulumi_azure_native/securityinsights/bookmark.py
sebtelko/pulumi-azure-native
0
6625305
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
en
0.702084
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a Bookmark resource. :param pulumi.Input[str] display_name: The display name of the bookmark :para...
1.743842
2
tests/test_runner.py
idekerlab/cdapsutil
0
6625306
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_runner ---------------------------------- Tests for `cdapsutil.runner` module. """ import os import stat import sys import tempfile import shutil import unittest import ndex2 import cdapsutil from cdapsutil.runner import Runner class TestRunner(unittest.TestC...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_runner ---------------------------------- Tests for `cdapsutil.runner` module. """ import os import stat import sys import tempfile import shutil import unittest import ndex2 import cdapsutil from cdapsutil.runner import Runner class TestRunner(unittest.TestC...
en
0.304821
#!/usr/bin/env python # -*- coding: utf-8 -*- test_runner ---------------------------------- Tests for `cdapsutil.runner` module. :return:
2.371505
2
arch/api/test/dummy_test.py
chenj133/FATE
3
6625307
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
en
0.820728
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2.230907
2
python_crash_course/functions/make_album.py
heniu1985/Learning
0
6625308
def make_album(artist, title, tracks): """Zwraca słownik z informacją o artyście, tytule albumu i liczbie utworów""" album = {"Artysta": artist, "Tytuł": title, "Liczba utworów": int(tracks)} return album while True: print("Podaj nazwę artysty, tytuł albumu i liczbę utworów na płycie:") print("(w c...
def make_album(artist, title, tracks): """Zwraca słownik z informacją o artyście, tytule albumu i liczbie utworów""" album = {"Artysta": artist, "Tytuł": title, "Liczba utworów": int(tracks)} return album while True: print("Podaj nazwę artysty, tytuł albumu i liczbę utworów na płycie:") print("(w c...
pl
0.998608
Zwraca słownik z informacją o artyście, tytule albumu i liczbie utworów
3.8401
4
inselect/tests/lib/test_sparse_date.py
NaturalHistoryMuseum/inselect
128
6625309
import datetime import unittest from inselect.lib.inselect_error import InselectError from inselect.lib.sparse_date import SparseDate class TestSparseDate(unittest.TestCase): def test_init(self): self.assertRaises(ValueError, SparseDate, None, None, None) self.assertEqual((2012, 1, 1), tuple(Spar...
import datetime import unittest from inselect.lib.inselect_error import InselectError from inselect.lib.sparse_date import SparseDate class TestSparseDate(unittest.TestCase): def test_init(self): self.assertRaises(ValueError, SparseDate, None, None, None) self.assertEqual((2012, 1, 1), tuple(Spar...
en
0.870359
# February in a leap year # February in a non-leap year # Zero year, month or day # Equal # Not equal # Greater # Less # Can't compare SparseDates of different resolutions
2.932548
3
runs/kubernetes/start_haproxy_bak.py
Ruilkyu/kubernetes_start
2
6625310
<reponame>Ruilkyu/kubernetes_start<filename>runs/kubernetes/start_haproxy_bak.py """ 时间:2020/6/13 作者:lurui 功能:在master部署并启动haproxy """ import os import subprocess import time def start_haproxy(): basedir = os.path.dirname(os.path.dirname(os.getcwd())) haproxy_path = basedir + '/deploy/haproxy' masterpath ...
""" 时间:2020/6/13 作者:lurui 功能:在master部署并启动haproxy """ import os import subprocess import time def start_haproxy(): basedir = os.path.dirname(os.path.dirname(os.getcwd())) haproxy_path = basedir + '/deploy/haproxy' masterpath = basedir + '/ansible/hosts/master_hosts' print("Sir,Starting Copy Haproxy C...
en
0.339652
时间:2020/6/13 作者:lurui 功能:在master部署并启动haproxy ansible master -i {0} -m copy -a "src={1}/cfg/haproxy.cfg dest=/etc/haproxy/" ansible master -i {0} -m copy -a "src={1}/svc/haproxy.service dest=/usr/lib/systemd/system/" ansible master -i {0} -m copy -a "src={1}/bin dest=/tmp/" ansible master -i {0} -m shell -a "systemctl s...
2.339352
2
CrashCourse/birthday.py
axetang/AxePython
1
6625311
<filename>CrashCourse/birthday.py<gh_stars>1-10 age = 23 message = "Happy " + str(age) + "rd Birthday!" print(message, 3/2, 3/2.0) # this is comment
<filename>CrashCourse/birthday.py<gh_stars>1-10 age = 23 message = "Happy " + str(age) + "rd Birthday!" print(message, 3/2, 3/2.0) # this is comment
en
0.952623
# this is comment
2.841553
3
main.py
PracowniaProg/minesweeper
0
6625312
<filename>main.py import sys from PyQt5.QtWidgets import QApplication from source.gui import MainWidget # Starting the application if __name__ == '__main__': app = QApplication(sys.argv) w = MainWidget() w.setWindowTitle("Minesweeper") w.show() sys.exit(app.exec_())
<filename>main.py import sys from PyQt5.QtWidgets import QApplication from source.gui import MainWidget # Starting the application if __name__ == '__main__': app = QApplication(sys.argv) w = MainWidget() w.setWindowTitle("Minesweeper") w.show() sys.exit(app.exec_())
en
0.814578
# Starting the application
2.738351
3
ibis/tests/expr/test_case.py
GrapeBaBa/ibis
1
6625313
<reponame>GrapeBaBa/ibis import ibis import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.types as ir from ibis.tests.util import assert_equal, assert_pickle_roundtrip def test_ifelse(table): bools = table.g.isnull() result = bools.ifelse("foo", "bar") assert isinstance(res...
import ibis import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.types as ir from ibis.tests.util import assert_equal, assert_pickle_roundtrip def test_ifelse(table): bools = table.g.isnull() result = bools.ifelse("foo", "bar") assert isinstance(result, ir.StringColumn) d...
none
1
2.32357
2
hiargparse/alternatives/__init__.py
KKawamura1/hiargparse
4
6625314
<gh_stars>1-10 from .arg_parse import ArgumentParser from .namespace import Namespace
from .arg_parse import ArgumentParser from .namespace import Namespace
none
1
1.230838
1
app/modules/User/routes/userACPBlueprint.py
VadymHutei/ukubuka
0
6625315
<filename>app/modules/User/routes/userACPBlueprint.py from flask import Blueprint, request from modules.Language.requestDecorators import languageRedirect from modules.Session.requestDecorators import withSession from modules.User.controllers.UserACPController import UserACPController userACPBlueprint = Blueprint('u...
<filename>app/modules/User/routes/userACPBlueprint.py from flask import Blueprint, request from modules.Language.requestDecorators import languageRedirect from modules.Session.requestDecorators import withSession from modules.User.controllers.UserACPController import UserACPController userACPBlueprint = Blueprint('u...
none
1
2.27075
2
masterCategory.py
bKolisnik/Condition-CNN
1
6625316
<filename>masterCategory.py import tensorflow as tf from tensorflow.keras.applications.resnet50 import ResNet50 from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.applications.inception_v3 import InceptionV3 from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, MaxPooling2D, Flatte...
<filename>masterCategory.py import tensorflow as tf from tensorflow.keras.applications.resnet50 import ResNet50 from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.applications.inception_v3 import InceptionV3 from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, MaxPooling2D, Flatte...
en
0.685959
This model is based off of VGG16 with the addition of BatchNorm layers and then branching #--- block 1 --- #--- block 2 --- #--- block 3 --- #--- block 4 --- #--- block 5 masterCategory --- #--- masterCategory prediction--- #trainable_params = tf.keras.backend.count_params(model.trainable_weights) #Keras will automatic...
2.537768
3
src/lbzdisc/cogs.py
deafmute1/listenbrainz-disc
1
6625317
<reponame>deafmute1/listenbrainz-disc #stdlib from enum import Enum from typing import Iterable, Tuple, Union, Optional import logging import importlib.metadata from datetime import datetime #self import lbzdisc.utils as utils from lbzdisc.data import DataManager #pypi from discord.ext import commands import disc...
#stdlib from enum import Enum from typing import Iterable, Tuple, Union, Optional import logging import importlib.metadata from datetime import datetime #self import lbzdisc.utils as utils from lbzdisc.data import DataManager #pypi from discord.ext import commands import discord import pylistenbrainz import mus...
en
0.511567
#stdlib #self #pypi
2.194691
2
t.py
Jie-OY/-
2
6625318
<filename>t.py # -*- coding: utf-8 -*- """ @author: W@I@S@E @contact: <EMAIL> @site: http://hfutoyj.cn/ @file: t.py @time: 2017/9/8 13:02 """ import copy from collections import defaultdict l = ['ab', 'abc', 'b', 'bc'] tmp = [] for i in l: tmp.append(i[0]) r = set(tmp) print(r) d = {1: 2, 3: 4} while True:...
<filename>t.py # -*- coding: utf-8 -*- """ @author: W@I@S@E @contact: <EMAIL> @site: http://hfutoyj.cn/ @file: t.py @time: 2017/9/8 13:02 """ import copy from collections import defaultdict l = ['ab', 'abc', 'b', 'bc'] tmp = [] for i in l: tmp.append(i[0]) r = set(tmp) print(r) d = {1: 2, 3: 4} while True:...
en
0.315418
# -*- coding: utf-8 -*- @author: W@I@S@E @contact: <EMAIL> @site: http://hfutoyj.cn/ @file: t.py @time: 2017/9/8 13:02
2.963952
3
ucsmsdk/mometa/firmware/FirmwareBootDefinition.py
anoop1984/python_sdk
0
6625319
<gh_stars>0 """This module contains the general information for FirmwareBootDefinition ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class FirmwareBootDefinitionConsts(): TYPE_ADAPTOR = "adaptor...
"""This module contains the general information for FirmwareBootDefinition ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class FirmwareBootDefinitionConsts(): TYPE_ADAPTOR = "adaptor" TYPE_B...
en
0.468669
This module contains the general information for FirmwareBootDefinition ManagedObject. This is FirmwareBootDefinition class. ((deleteAll|ignore|deleteNonPresent),){0,2}(deleteAll|ignore|deleteNonPresent){0,1} ((none|del|mod|addchild|cascade),){0,4}(none|del|mod|addchild|cascade){0,1} ((removed|created|modified|deleted)...
2.04085
2
py2/ex31.py
iamovrhere/lpthw
0
6625320
prompt = "> " print "You enter a dark room with two doors. Do you go through door #1 or door #2" door = raw_input(prompt) if door == "1": print "There's a giant bear here eating cheese cake. What do you do?" print "1. Take the cake" print "2. Scream at the bear" bear = raw_input(prompt) if bear ...
prompt = "> " print "You enter a dark room with two doors. Do you go through door #1 or door #2" door = raw_input(prompt) if door == "1": print "There's a giant bear here eating cheese cake. What do you do?" print "1. Take the cake" print "2. Scream at the bear" bear = raw_input(prompt) if bear ...
nl
0.506358
#1 or door #2"
3.80525
4
bsd2/vagrant-ansible/ansible/lib/ansible/runner/lookup_plugins/env.py
dlab-berkeley/collaboratool-archive
1
6625321
# (c) 2012, <NAME> <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
# (c) 2012, <NAME> <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
en
0.878479
# (c) 2012, <NAME> <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
1.980739
2
immvis/grpc/mappers/kmeans_analysis_mapping.py
imdavi/immvis-server
0
6625322
<filename>immvis/grpc/mappers/kmeans_analysis_mapping.py from ..proto.immvis_pb2 import KMeansAnalysisResponse, NormalisedDataset from pandas import DataFrame def map_to_k_means_analysis_response(k_means_analysis_result) -> KMeansAnalysisResponse: return KMeansAnalysisResponse( labelsMapping=_map_to_data_f...
<filename>immvis/grpc/mappers/kmeans_analysis_mapping.py from ..proto.immvis_pb2 import KMeansAnalysisResponse, NormalisedDataset from pandas import DataFrame def map_to_k_means_analysis_response(k_means_analysis_result) -> KMeansAnalysisResponse: return KMeansAnalysisResponse( labelsMapping=_map_to_data_f...
none
1
2.248303
2
paddlex/paddleseg/models/sfnet.py
cheneyveron/PaddleX
3,655
6625323
<reponame>cheneyveron/PaddleX<filename>paddlex/paddleseg/models/sfnet.py # Copyright (c) 2021 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 # # ...
# Copyright (c) 2021 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 applic...
en
0.709685
# Copyright (c) 2021 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 applic...
2.197904
2
zerver/forms.py
rhencke/zulip
0
6625324
<gh_stars>0 from django import forms from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm, \ PasswordResetForm from django.core.exceptions import ValidationError from django.urls import reverse from django.core.valid...
from django import forms from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm, \ PasswordResetForm from django.core.exceptions import ValidationError from django.urls import reverse from django.core.validators import ...
en
0.889647
Prevent MIT mailing lists from signing up for Zulip # Check whether the user exists and can get mail. # The required-ness of the password field gets overridden if it isn't # actually required for a realm # Since the superclass doesn't except random extra kwargs, we # remove it from the kwargs dict before initializing. ...
1.30202
1
tdda/constraints/flags.py
jjlee42/tdda
0
6625325
<gh_stars>0 # -*- coding: utf-8 -*- """ Helpers for command-line option flags for discover and verify """ from __future__ import division from __future__ import print_function from __future__ import absolute_import import argparse import sys DISCOVER_HELP = ''' Optional flags are: * -r or --rex Include re...
# -*- coding: utf-8 -*- """ Helpers for command-line option flags for discover and verify """ from __future__ import division from __future__ import print_function from __future__ import absolute_import import argparse import sys DISCOVER_HELP = ''' Optional flags are: * -r or --rex Include regular expres...
en
0.678302
# -*- coding: utf-8 -*- Helpers for command-line option flags for discover and verify Optional flags are: * -r or --rex Include regular expression generation * -R or --norex Exclude regular expression generation (the default) Optional flags are: * -a, --all Report all fields, even if there are...
2.851411
3
oscarapi/tests/unit/testcheckout.py
ski-family/django-oscar-api
311
6625326
from decimal import Decimal from mock import patch from django.contrib.auth import get_user_model from django.urls import reverse from django.test.client import RequestFactory from oscar.core.loading import get_model from rest_framework.response import Response from oscarapi.tests.utils import APITest from oscarapi...
from decimal import Decimal from mock import patch from django.contrib.auth import get_user_model from django.urls import reverse from django.test.client import RequestFactory from oscar.core.loading import get_model from rest_framework.response import Response from oscarapi.tests.utils import APITest from oscarapi...
en
0.897809
# first create a basket and a checkout payload # create a request and user for the serializer # see https://github.com/django-oscar/django-oscar-api/issues/188 Test if an order can be placed as an authenticated user with session based auth. Prove that the user 'nobody' can checkout his cart when authenticating with hea...
2.067074
2
phase2_stuff/swasp/swasp_fits_to_dat.py
davidjwilson/pceb
0
6625327
<reponame>davidjwilson/pceb import pyfits as fits #incase I want to use it on work desktop #from astropy.io import fits import matplotlib.pyplot as plt import numpy as np import os #turns SWASP fits files into dat files. star='UZ_Sex' #for fits_file in files: # if fits_file[-4:] == 'mxlo': hdulist = fits.open('1S...
import pyfits as fits #incase I want to use it on work desktop #from astropy.io import fits import matplotlib.pyplot as plt import numpy as np import os #turns SWASP fits files into dat files. star='UZ_Sex' #for fits_file in files: # if fits_file[-4:] == 'mxlo': hdulist = fits.open('1SWASPJ102834.89-000029.1.fits...
en
0.329262
#incase I want to use it on work desktop #from astropy.io import fits #turns SWASP fits files into dat files. #for fits_file in files: # if fits_file[-4:] == 'mxlo': f = scidata['FLUX'][0] w = [scidata['WAVELENGTH'][0]+i*scidata['DELTAW'][0] for i in xrange(len(f))] #e = scidata['SIGMA'][0] #print w w, f, = np.array(w)...
2.4834
2
habitat_baselines/rl/ppo/policy.py
erick84mm/habitat-api
1
6625328
<reponame>erick84mm/habitat-api<filename>habitat_baselines/rl/ppo/policy.py #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import abc import numpy as np import torch i...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import abc import numpy as np import torch import torch.nn as nn from habitat_baselines.common.utils import Categorical...
en
0.92462
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Network which passes the input image through CNN and concatenates goal vector with CNN's output and passes that throug...
2.192237
2
pkg/suggestion/v1alpha1/tests/test_algorithm_manager.py
terrytangyuan/katib
6
6625329
import os import yaml import pytest import numpy as np from box import Box from pkg.api.v1alpha1.python import api_pb2 from ..bayesianoptimization.src.algorithm_manager import AlgorithmManager TEST_DIR = os.path.dirname(os.path.realpath(__file__)) @pytest.fixture def study_config(): with open(os.path.join(TES...
import os import yaml import pytest import numpy as np from box import Box from pkg.api.v1alpha1.python import api_pb2 from ..bayesianoptimization.src.algorithm_manager import AlgorithmManager TEST_DIR = os.path.dirname(os.path.realpath(__file__)) @pytest.fixture def study_config(): with open(os.path.join(TES...
none
1
1.982436
2
statdyn/figures/interactive_config.py
malramsay64/MD-Molecules-Hoomd
1
6625330
<reponame>malramsay64/MD-Molecules-Hoomd<filename>statdyn/figures/interactive_config.py #! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. # # pylint: skip-file """Create an interactive view of a configuration.""" impor...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. # # pylint: skip-file """Create an interactive view of a configuration.""" import functools import logging from functools import partial from pathlib import Path impor...
en
0.798493
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. # # pylint: skip-file Create an interactive view of a configuration. # Definition of initial state # Bokeh will cope with IndexError in file but not beginning and end # o...
1.972119
2
PointMatcher/utils/qt.py
daisatojp/PointMatcher
2
6625331
import os import os.path as osp import re import sys from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5 import QtWidgets from PointMatcher.utils.filesystem import icon_path def newButton(text, icon=None, slot=None): b = QtWidgets.QPushButton(text) if icon is not None: b.setIcon(QtGui.QIcon(ic...
import os import os.path as osp import re import sys from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5 import QtWidgets from PointMatcher.utils.filesystem import icon_path def newButton(text, icon=None, slot=None): b = QtWidgets.QPushButton(text) if icon is not None: b.setIcon(QtGui.QIcon(ic...
en
0.63101
Create a new action and assign callbacks, shortcuts, etc.
2.434392
2
chapterfour/magicians.py
cmotek/python_crashcourse
0
6625332
magicians = ['alice', 'david', 'carolina'] for magician in magicians: print(f"{magician.title()}, that was a great trick!") print(f"I can't wait to see your next trick, {magician.title()}.\n") print("Thank you, everyone. That was a great magic show!")
magicians = ['alice', 'david', 'carolina'] for magician in magicians: print(f"{magician.title()}, that was a great trick!") print(f"I can't wait to see your next trick, {magician.title()}.\n") print("Thank you, everyone. That was a great magic show!")
none
1
3.149302
3
src/webapi/migrations/0052_image_video.py
kumagallium/labmine-api
0
6625333
# Generated by Django 2.2.1 on 2021-02-17 04:27 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('webapi', '0051_explanati...
# Generated by Django 2.2.1 on 2021-02-17 04:27 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('webapi', '0051_explanati...
en
0.819112
# Generated by Django 2.2.1 on 2021-02-17 04:27
1.746673
2
h/storage.py
y3g0r/h
0
6625334
# -*- coding: utf-8 -*- """ Annotation storage API. This module provides the core API with access to basic persistence functions for storing and retrieving annotations. Data passed to these functions is assumed to be validated. """ # FIXME: This module was originally written to be a single point of # indirectio...
# -*- coding: utf-8 -*- """ Annotation storage API. This module provides the core API with access to basic persistence functions for storing and retrieving annotations. Data passed to these functions is assumed to be validated. """ # FIXME: This module was originally written to be a single point of # indirectio...
en
0.837322
# -*- coding: utf-8 -*- Annotation storage API. This module provides the core API with access to basic persistence functions for storing and retrieving annotations. Data passed to these functions is assumed to be validated. # FIXME: This module was originally written to be a single point of # indirection throug...
2.604407
3
elasticapm/traces.py
HonzaKral/apm-agent-python
0
6625335
<reponame>HonzaKral/apm-agent-python<gh_stars>0 # BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of sourc...
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
en
0.756522
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
0.958052
1
Leetcode/65. Valid Number/solution2.py
asanoviskhak/Outtalent
51
6625336
<gh_stars>10-100 import re P0 = re.compile('^[-+]?(\d+\.\d*|\d*\.\d+|\d+)$') P1 = re.compile('^[-+]?\d+\s*$') class Solution: def isNumber(self, s: str) -> bool: s = s.strip() if 'e' in s: a = s.split('e') if len(a) > 2: return False return P0.match(a[0]) and ...
import re P0 = re.compile('^[-+]?(\d+\.\d*|\d*\.\d+|\d+)$') P1 = re.compile('^[-+]?\d+\s*$') class Solution: def isNumber(self, s: str) -> bool: s = s.strip() if 'e' in s: a = s.split('e') if len(a) > 2: return False return P0.match(a[0]) and P1.match(a[1]) ...
none
1
3.383423
3
buildAssetBundle/buildAssetBundle.py
iGameDesign/iLittleTools
0
6625337
# -*- coding: UTF-8 -*- ''' Copyright(c) Funova FileName : buildAssetBundle.py Creator : pengpeng Date : 2014-12-25 11:11 Comment : ModifyHistory : ''' __version__ = '1.0.0.0' __author__ = 'pengpeng' import os, sys import string import re import argparse import md5, hashlib fr...
# -*- coding: UTF-8 -*- ''' Copyright(c) Funova FileName : buildAssetBundle.py Creator : pengpeng Date : 2014-12-25 11:11 Comment : ModifyHistory : ''' __version__ = '1.0.0.0' __author__ = 'pengpeng' import os, sys import string import re import argparse import md5, hashlib fr...
en
0.260837
# -*- coding: UTF-8 -*- Copyright(c) Funova FileName : buildAssetBundle.py Creator : pengpeng Date : 2014-12-25 11:11 Comment : ModifyHistory : 1. 编码转换 2. 生成meta文件 fileFormatVersion: 2 guid: %s DefaultImporter: userData: # print ext # print filename #print "convert " + inputfile,...
2.109826
2
python-package/lightgbm/engine.py
rocknOdairi/LightGBM
0
6625338
<gh_stars>0 # coding: utf-8 """Library with training routines of LightGBM.""" import collections import copy from operator import attrgetter from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Tuple, Union import numpy as np from . import callback from .basic import Booster, Dataset, Ligh...
# coding: utf-8 """Library with training routines of LightGBM.""" import collections import copy from operator import attrgetter from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Tuple, Union import numpy as np from . import callback from .basic import Booster, Dataset, LightGBMError, _...
en
0.70688
# coding: utf-8 Library with training routines of LightGBM. Perform the training with given parameters. Parameters ---------- params : dict Parameters for training. train_set : Dataset Data to be trained on. num_boost_round : int, optional (default=100) Number of boosting it...
2.511728
3
bin/bitfinex.py
yuhan-wang/whalewatch
1
6625339
import collections import kafka from bfxapi import Client from order_book import OrderBook from order_book import kafka_send bfx = Client() exchange = "Bitfinex" host = ['localhost:9092'] producer = kafka.KafkaProducer(bootstrap_servers=host) kafka.KafkaClient(bootstrap_servers=host).add_topic('all') with open('./t...
import collections import kafka from bfxapi import Client from order_book import OrderBook from order_book import kafka_send bfx = Client() exchange = "Bitfinex" host = ['localhost:9092'] producer = kafka.KafkaProducer(bootstrap_servers=host) kafka.KafkaClient(bootstrap_servers=host).add_topic('all') with open('./t...
none
1
2.376256
2
indi_mr/fromindi.py
bernie-skipole/indi-mr
0
6625340
<reponame>bernie-skipole/indi-mr<gh_stars>0 ################### # # fromindi.py # ################### """Reads indi xml strings, parses them and places values into redis, ready for reading by the web server.""" import xml.etree.ElementTree as ET import os, math, json, pathlib from datetime import datetime fro...
################### # # fromindi.py # ################### """Reads indi xml strings, parses them and places values into redis, ready for reading by the web server.""" import xml.etree.ElementTree as ET import os, math, json, pathlib from datetime import datetime from base64 import standard_b64decode, standard_b...
en
0.789693
################### # # fromindi.py # ################### Reads indi xml strings, parses them and places values into redis, ready for reading by the web server. # All xml data received should be contained in one of the following tags ########## redis keys and channels # redis keys and data # # one key : set # 'd...
2.457281
2
examples/leduc_holdem_cfr.py
drunkpig/rlcard
0
6625341
''' An example of solve Leduc Hold'em with CFR ''' import numpy as np import rlcard from rlcard.agents.cfr_agent import CFRAgent from rlcard import models from rlcard.utils.utils import set_global_seed, tournament from rlcard.utils.logger import Logger # Make environment and enable human mode env = rlcard.make('leduc...
''' An example of solve Leduc Hold'em with CFR ''' import numpy as np import rlcard from rlcard.agents.cfr_agent import CFRAgent from rlcard import models from rlcard.utils.utils import set_global_seed, tournament from rlcard.utils.logger import Logger # Make environment and enable human mode env = rlcard.make('leduc...
en
0.860778
An example of solve Leduc Hold'em with CFR # Make environment and enable human mode # Set the iterations numbers and how frequently we evaluate the performance and save model # The paths for saving the logs and learning curves # Set a global seed # Initilize CFR Agent # If we have saved model, we first load the model #...
2.684956
3
mil_reptile.py
ryanbrand/mil
0
6625342
<reponame>ryanbrand/mil """ This file defines Meta Imitation Learning (MIL). """ from __future__ import division import numpy as np import random import tensorflow as tf from tensorflow.python.platform import flags from tf_utils import * from utils import Timer from natsort import natsorted FLAGS = flags.FLAGS class...
""" This file defines Meta Imitation Learning (MIL). """ from __future__ import division import numpy as np import random import tensorflow as tf from tensorflow.python.platform import flags from tf_utils import * from utils import Timer from natsort import natsorted FLAGS = flags.FLAGS class MIL(object): """ In...
en
0.770851
This file defines Meta Imitation Learning (MIL). Initialize MIL. Need to call init_network to contruct the architecture after init. # MIL hyperparams # by default, we use relu # List of indices for state (vector) data and image (tensor) data in observation. # Dimension of input and output of the model Helper method to ...
2.675035
3
molgym/buffer.py
polyzer/molgym
1
6625343
# The content of this file is based on: OpenAI Spinning Up https://spinningup.openai.com/. from typing import Optional, List import numpy as np from molgym.spaces import ObservationType from molgym.tools import util from molgym.tools.mpi import mpi_mean_std class PPOBuffer: """ A buffer for storing trajecto...
# The content of this file is based on: OpenAI Spinning Up https://spinningup.openai.com/. from typing import Optional, List import numpy as np from molgym.spaces import ObservationType from molgym.tools import util from molgym.tools.mpi import mpi_mean_std class PPOBuffer: """ A buffer for storing trajecto...
en
0.911601
# The content of this file is based on: OpenAI Spinning Up https://spinningup.openai.com/. A buffer for storing trajectories experienced by a PPO agent interacting with the environment, and using Generalized Advantage Estimation (GAE-Lambda) for calculating the advantages of state-action pairs. # Filled when pa...
2.37406
2
venv/Lib/site-packages/IPython/core/tests/test_displayhook.py
ajayiagbebaku/NFL-Model
1,318
6625344
import sys from IPython.testing.tools import AssertPrints, AssertNotPrints from IPython.core.displayhook import CapturingDisplayHook from IPython.utils.capture import CapturedIO def test_output_displayed(): """Checking to make sure that output is displayed""" with AssertPrints('2'): ip.run_cell('1+1'...
import sys from IPython.testing.tools import AssertPrints, AssertNotPrints from IPython.core.displayhook import CapturingDisplayHook from IPython.utils.capture import CapturedIO def test_output_displayed(): """Checking to make sure that output is displayed""" with AssertPrints('2'): ip.run_cell('1+1'...
en
0.613298
Checking to make sure that output is displayed # comment with a semicolon;', store_history=True) #commented_out_function();', store_history=True) Checking to make sure that output is quiet # comment with a semicolon', store_history=True) #commented_out_function()', store_history=True) Test that ast nodes can be trigger...
2.474473
2
gui/qt/__init__.py
mpatc/Electron-Cash
1
6625345
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 restr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 restr...
en
0.877024
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 restr...
2.080909
2
src/char/sorceress/blizz_sorc.py
thordin9/botty
0
6625346
import keyboard from char.sorceress import Sorceress from utils.custom_mouse import mouse from logger import Logger from utils.misc import wait, rotate_vec, unit_vector import random from pather import Location import numpy as np class BlizzSorc(Sorceress): def __init__(self, *args, **kwargs): Logger.info...
import keyboard from char.sorceress import Sorceress from utils.custom_mouse import mouse from logger import Logger from utils.misc import wait, rotate_vec, unit_vector import random from pather import Location import numpy as np class BlizzSorc(Sorceress): def __init__(self, *args, **kwargs): Logger.info...
en
0.771726
# Move to items # Top left position # Lower left posistion # Teledance 1 # Teledance attack 1 # Teledance 2 # Teledance attack 2 # Shenk Kill # Shenk attack 1 # Shenk teledance 2 # Move to items # Check out the node screenshot in assets/templates/trav/nodes to see where each node is at # Go inside cast stuff in general...
2.193133
2
tegrity/settings.py
kevmo314/tegrity
20
6625347
<filename>tegrity/settings.py import os import shutil # the CONFIG_PATH just points to the logs, cache, and saved configurations. # change this to 755 if you want your ~/.tegrity folder to be world readable import tegrity CONFIG_PATH_MODE = 0o700 # change this if conflict with an existing ~/.tegrity folder you want ...
<filename>tegrity/settings.py import os import shutil # the CONFIG_PATH just points to the logs, cache, and saved configurations. # change this to 755 if you want your ~/.tegrity folder to be world readable import tegrity CONFIG_PATH_MODE = 0o700 # change this if conflict with an existing ~/.tegrity folder you want ...
en
0.845396
# the CONFIG_PATH just points to the logs, cache, and saved configurations. # change this to 755 if you want your ~/.tegrity folder to be world readable # change this if conflict with an existing ~/.tegrity folder you want to keep # for download.py # todo: implement, since python bzip is really slow # for kernel.py # t...
1.909679
2
util/bin-to-h.py
PokeyManatee4/splatood
98
6625348
<gh_stars>10-100 import sys use_rle = False if "--rle" in sys.argv: use_rle = True out = [] previous = "NO" count = 0 with open(sys.argv[1]) as f: x = f.read() for i in x: c = hex(ord(i)) if len(c) == len('0x0'): c = c[:2] + '0' + c[2] if use_rle: if c == previous: count += 1 else: if coun...
import sys use_rle = False if "--rle" in sys.argv: use_rle = True out = [] previous = "NO" count = 0 with open(sys.argv[1]) as f: x = f.read() for i in x: c = hex(ord(i)) if len(c) == len('0x0'): c = c[:2] + '0' + c[2] if use_rle: if c == previous: count += 1 else: if count: out.appen...
none
1
2.873965
3
control_gpio_pi/51low.py
Rahul14singh/remote_raspberrypigpio_control
10
6625349
import RPi.GPIO as ir print "PIN 3 Low" ir.setwarnings(False) ir.setmode(ir.BOARD) ir.setup(3,ir.OUT) ir.output(3,ir.LOW)
import RPi.GPIO as ir print "PIN 3 Low" ir.setwarnings(False) ir.setmode(ir.BOARD) ir.setup(3,ir.OUT) ir.output(3,ir.LOW)
none
1
2.878637
3
aprendizado/curso_em_video/desafios/desafio061.py
renatodev95/Python
0
6625350
<reponame>renatodev95/Python termo = int(input('Digite o primeiro termo: ')) razão = int(input('Razão da PA: ')) c = 1 while c <= 10: print('{} ➡'.format(termo), end=' ') termo += razão c += 1 print('FIM')
termo = int(input('Digite o primeiro termo: ')) razão = int(input('Razão da PA: ')) c = 1 while c <= 10: print('{} ➡'.format(termo), end=' ') termo += razão c += 1 print('FIM')
none
1
3.86653
4