prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitDaugh... | return True |
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS):
def <|fim_middle|>(self):
"""
Creates the himesis graph representing the AToM3 model HUni... | __init__ |
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitDaugh... | eval_attr11 |
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitDaugh... | eval_attr12 |
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitDaugh... | eval_attr13 |
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitDaugh... | constraint |
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | # any later version.
# This file is distributed in the hope that it will be useful, |
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | (year % 100) == 0:
if (year % 400) == 0:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
else:
print("{0} is a leap year".format(year))
e |
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | (year % 400) == 0:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
|
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | nt("{0} is a leap year".format(year))
|
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | nt("{0} is not a leap year".format(year))
|
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | nt("{0} is a leap year".format(year))
e |
<|file_name|>leap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it unde... | nt("{0} is not a leap year".format(year))
|
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for comic project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discove... |
sys.path.append(SITE_ROOT)
sys.path.append(os.path.join(SITE_ROOT,"comic")) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | # cipherValue = ((int)(plainText[i] - 65 + key) % 26 + 65)
# cipher = (char)(cipherValue)
# print("%c", cipher)
# i++ |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
<|fim_middle|>
def caesar(char, kplainText):
if char.isupper():
return chr(((ord(char) - 65 + kplainText) % 26) + 65)
else:
return chr(((ord(char) - 97 + kplainText) % 26) + 97)
if __name__ == ... | if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = int(sys.argv[1])
cipher = []
plainText = cs50.get_string()
for symbol in plain... |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | if char.isupper():
return chr(((ord(char) - 65 + kplainText) % 26) + 65)
else:
return chr(((ord(char) - 97 + kplainText) % 26) + 97) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
<|fim_middle|>
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = int(sys.argv[1])
cipher = []
plain... | print("You should provide cmd line arguments!")
exit(1) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | cipher.append(caesar(symbol, kplainText)) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | cipher.append(symbol) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | return chr(((ord(char) - 65 + kplainText) % 26) + 65) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | return chr(((ord(char) - 97 + kplainText) % 26) + 97) |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | main() |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def <|fim_middle|>():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplai... | main |
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50
import sys
def main():
if len(sys.argv) != 2:
print("You should provide cmd line arguments!")
exit(1)
#if sys.argv[1].isalpha() == False:
#print("You should provide valid key!")
#exit(1)
kplainText = in... | caesar |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... |
i = 0 |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | """ Yield successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
yield l[i:i + n] |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | help = \
'''Sends an e-mail to all users in a text file.
E.g.
manage.py userlist.txt message logfile.txt rate
userlist.txt -- list of all users
message -- prefix for template with message
logfile.txt -- where to log progress
rate -- messages per second
'''
log_file = None
def hard_log(self, text):
... |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | self.log_file.write(datetime.datetime.utcnow().isoformat() + ' -- ' + text + '\n') |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | (user_file, message_base, logfilename, ratestr) = args
users = [u.strip() for u in open(user_file).readlines()]
message = middleware.lookup['main'].get_template('emails/' + message_base + "_body.txt").render()
subject = middleware.lookup['main'].get_template('emails/' + message_base + ... |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | self.log_file.close()
sys.exit(-1) |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | chunks |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | hard_log |
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path
import time
from django.core.management.base import BaseCommand
from django.conf import settings
import mitxmako.middleware as middleware
from django.core.mail import send_mass_mail
import sys
import datetime
middleware.MakoMiddleware()
def... | handle |
<|file_name|>task_5_6.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Velyan A. S.
# 27.05.2016
print("\nназвание одного из двух спутников Марса:")
import random
satellite=["Фобос", "Деймос"]
s=random.choice(satellite)
print(s)
input("Нажмите Enter для выхода")<|fim▁end|> | # Задача 5. Вариант 6.
# Напишите программу, которая бы при запуске случайным образом отображала название одного из двух спутников Марса.
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from models import Connection
from django import forms
class ConnectionForm(forms.ModelForm):
class Meta:
model = Connection<|fim▁hole|><|fim▁end|> | exclude = ('d_object_id',) |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from models import Connection
from django import forms
class ConnectionForm(forms.ModelForm):
<|fim_middle|>
<|fim▁end|> | class Meta:
model = Connection
exclude = ('d_object_id',) |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from models import Connection
from django import forms
class ConnectionForm(forms.ModelForm):
class Meta:
<|fim_middle|>
<|fim▁end|> | model = Connection
exclude = ('d_object_id',) |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | # limitations under the License.
# --- This file has been autogenerated --- # |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | """Scan over Ry(theta) angles from -pi/2 to 3pi/2 tracing out a sinusoid
which is primarily affected by readout error.
See Also:
:py:func:`run_readout_scan`
Attributes:
dataset_id: A unique identifier for this dataset.
device_name: The device to run on, by name.
n_shots... |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | n_shots = _abbrev_n_shots(n_shots=self.n_shots)
qubit = _abbrev_grid_qubit(self.qubit)
return (f'{self.dataset_id}/'
f'{self.device_name}/'
f'q-{qubit}/'
f'ry_scan_{self.resolution_factor}_{n_shots}') |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | """Shorter n_shots component of a filename"""
if n_shots % 1000 == 0:
return f'{n_shots // 1000}k'
return str(n_shots) |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | """Formatted grid_qubit component of a filename"""
return f'{qubit.row}_{qubit.col}' |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | """Execute a :py:class:`ReadoutScanTask` task."""
if base_dir is None:
base_dir = DEFAULT_BASE_DIR
if recirq.exists(task, base_dir=base_dir):
print(f"{task} already exists. Skipping.")
return
# Create a simple circuit
theta = sympy.Symbol('theta')
circuit = cirq.Cir... |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | return f'{n_shots // 1000}k' |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | base_dir = DEFAULT_BASE_DIR |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | print(f"{task} already exists. Skipping.")
return |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | fn |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | _abbrev_n_shots |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | _abbrev_grid_qubit |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google
#
# 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 requi... | run_readout_scan |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | """
Run this plugin.
"""
if len(context.graph.vertices) < 1:
generate = True
else:
res = UI.prYesNo("Use current graph?",
"Would you like to apply the layout to the current graph? If not, a complete graph will be generated and the current graph cleared.")
... |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | """
k_n (C, n) -> void
Create a complete graph on n vertices in context C.
"""
from graph import Vertex, DummyVertex
G = C.graph
G.clear()
# Add n vertices
for i in range(n):
G.addVertex(Vertex(id='%d' % i, name='v%d' % i))
# For every pair of vertices (u, v):
for u... |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | """
Run moment curve layout (Cohen, Eades, Lin, Ruskey 1995).
"""
G = C.graph
from math import sqrt, ceil, floor
from graph import DummyVertex, GraphError
import colorsys
vertices = [x for x in G.vertices if not isinstance(x, DummyVertex)]
n = len(vertices)
# Choose a prime p ... |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | generate = True |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | res = UI.prYesNo("Use current graph?",
"Would you like to apply the layout to the current graph? If not, a complete graph will be generated and the current graph cleared.")
if res:
generate = False
# Go through and eliminate any existing bend points
... |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | generate = False
# Go through and eliminate any existing bend points
from graph import DummyVertex
for v in [x for x in context.graph.vertices if isinstance(x, DummyVertex)]:
context.graph.removeVertex(v) |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | generate = True |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | N = UI.prType("Number of Vertices", "Input number of vertices to generate complete graph:", int, 4)
if N == None:
return True
while N < 0:
N = UI.prType("Number of Vertices",
"Please input positive value.\n\nInput number of vertices to generate c... |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | return True |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | return True |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | G.addEdge((u, v)) |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | break |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | break |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | raise Exception, "Can't find a prime between %d and %d!" % (n + 1, 2 * n) |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | for i in range(n):
G.modVertex(vertices[i]).pos = (i * 10, ((i * i) % p) * 10, ((i * i * i) % p) * 10) |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | for i in range(n):
G.modVertex(vertices[i]).pos = (i, (i * i), (i * i * i)) |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | run |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | k_n |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | moment |
<|file_name|>spectrum_analyzer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import numpy as np
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
from koheron import connect
from drivers import Spectrum
from drivers import Laser
host... | mhz = 1e6
sampling_rate = 125e6 |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2014 Hamilton Kibbe <ham@hamiltonkib.be>
#
# 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 Softw... | # |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.map, name='map'),<|fim▁hole|>]<|fim▁end|> | url(r'^mapSim', views.mapSim, name='mapSim'),
url(r'^api/getPos', views.getPos, name='getPos'),
url(r'^api/getProjAndPos', views.getProjAndPos, name='getProjAndPos'), |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | self.logger.error("Failed to load the HLS playlist for {0}", channel)
def _get_streams(self): |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
<|fim_middle|>
__plugin__ ... | url_re = re.compile(r"https?://(?:www\.)?(?:tf1\.fr/(\w+)/direct|(lci).fr/direct)/?")
embed_url = "http://www.wat.tv/embedframe/live{0}"
embed_re = re.compile(r"urlLive.*?:.*?\"(http.*?)\"", re.MULTILINE)
api_url = "http://www.wat.tv/get/{0}/591997"
swf_url = "http://www.wat.tv/images/v70/PlayerLite... |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | return cls.url_re.match(url) is not None |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | channel = self.hds_channel_remap.get(channel, "{0}live".format(channel))
manifest_url = http.get(self.api_url.format(channel),
params={"getURL": 1},
headers={"User-Agent": useragents.FIREFOX}).text
for s in HDSStream.parse_manifest... |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | channel = self.hls_channel_remap.get(channel, channel)
embed_url = self.embed_url.format(channel)
self.logger.debug("Found embed URL: {0}", embed_url)
# page needs to have a mobile user agent
embed_page = http.get(embed_url, headers={"User-Agent": useragents.ANDROID})
m ... |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | m = self.url_re.match(self.url)
if m:
channel = m.group(1) or m.group(2)
self.logger.debug("Found channel {0}", channel)
for s in self._get_hds_streams(channel):
yield s
for s in self._get_hls_streams(channel):
yield s |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | hls_stream_url = m.group(1)
try:
for s in HLSStream.parse_variant_playlist(self.session, hls_stream_url).items():
yield s
except Exception:
self.logger.error("Failed to load the HLS playlist for {0}", channel) |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | channel = m.group(1) or m.group(2)
self.logger.debug("Found channel {0}", channel)
for s in self._get_hds_streams(channel):
yield s
for s in self._get_hls_streams(channel):
yield s |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | can_handle_url |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | _get_hds_streams |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | _get_hls_streams |
<|file_name|>tf1.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
class TF1(Plugin):
url_re = re.compile(r"https?:... | _get_streams |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | :param obj: Object to test
:return: True if the object is an enumeration item
"""
return isinstance(obj, enum.Enum) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | """
Converts the given string into bytes
"""
# pylint: disable=E0602
if type(string) is unicode:
return str(string)
return string |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | """
Converts the given bytes into a string
"""
if type(data) is str:
return data
return str(data) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | """
Converts the given string into bytes
"""
if type(string) is bytes:
return string
return bytes(string, "UTF-8") |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | """
Converts the given bytes into a string
"""
if type(data) is str:
return data
return str(data, "UTF-8") |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | """
Checks if an object is from an enumeration class
:param obj: Object to test
:return: True if the object is an enumeration item
"""
return isinstance(obj, enum.Enum) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | """
Before Python 3.4, enumerations didn't exist.
:param _: Object to test
:return: Always False
"""
return False |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | import types
try:
STRING_TYPES = (
types.StringType,
types.UnicodeType
)
except NameError:
# Python built without unicode support
STRING_TYPES = (types.StringType,)
NUMERIC_TYPES = (
types.IntType,
types.LongType,
types.Flo... |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | return str(string) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | return data |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | STRING_TYPES = (
bytes,
str
)
NUMERIC_TYPES = (
int,
float
)
def to_bytes(string):
"""
Converts the given string into bytes
"""
if type(string) is bytes:
return string
return bytes(string, "UTF-8")
def from_by... |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | return string |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | return data |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2017, Thomas Calmant
:license: Apache License 2.0
:version: 0.3.1
..
Copyright 2017 Thomas Calmant
... | to_bytes |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.